# Problems sending post requests

**URL:** <https://community.hubspot.com/t/problems-sending-post-requests/15586>\
**Category:** APIs & Integrations\
**Tags:** developer-tools, object\
**Created:** [August 2, 2019, 1:33pm UTC](https://community.hubspot.com/t/problems-sending-post-requests/15586 "2019-08-02T13:33:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![swoop](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/swoop/32/98997_2.png) [@swoop](https://community.hubspot.com/u/swoop)\
**Post date:** [August 2, 2019, 1:33pm UTC](https://community.hubspot.com/t/problems-sending-post-requests/15586/1 "2019-08-02T13:33:30Z")

</div>

Good day! I have an Angular app. I send a post request for

`https://api.hubapi.com/deals/v1/deal?hapikey=MY_API_KEY`

and get an error

OPTIONS [https://api.hubapi.com/deals/v1/deal?hapikey=my-key](https://api.hubapi.com/deals/v1/deal?hapikey=my-key) 401

Access to XMLHttpRequest at ‘[https://api.hubapi.com/deals/v1/deal?hapikey=!!!!!!!!!!!](https://api.hubapi.com/deals/v1/deal?hapikey=!!!!!!!!!!!)’ from origin ‘[http://localhost:4200](http://localhost:4200)’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

Tell me what’s wrong please. That is my code

`export class CrmService { private readonly key = 'my api-key'; private readonly API_URL = 'https://api.hubapi.com/'; private readonly DEAL_URL = `${this.API\_URL}deals/v1/deal?hapikey=${this.key}`; constructor(private http: HttpClient) {} private get headers() { return new HttpHeaders({'Content-Type': 'application/json'}); } sendOrder(param) { const url = this.DEAL_URL; const params = { 'properties': [{ 'value': `${param.name} ${param.surname}`, 'name': 'dealname' }, { 'value': `${param.cost}`, 'name': 'amount' }, { 'value': `${param.tel}`, 'name': 'telnumber' }, { 'value': `${param.recipient}`, 'name': 'email' }, { 'value': 'was deleted!!', 'name': 'hubspot_owner_id' }, { 'value': `${param.model} ${param.memory} ${param.condition}`, 'name': 'old' }, { 'value': `${param.tradeinModel} ${param.tradeinMemory} ${param.tradeinColor}`, 'name': 'new' }, { 'value': `${param.comment}`, 'name': 'comment' }, { 'value': `${param.address}`, 'name': 'adress' }, { 'value': `${param.day} ${param.time}`, 'name': 'time' }] }; return this.http.post(url, params, {headers: this.headers}); }`

---

<div class="post-metadata">

**Author:** ![swoop](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/swoop/32/98997_2.png) [@swoop](https://community.hubspot.com/u/swoop)\
**Post date:** [August 4, 2019, 12:42pm UTC](https://community.hubspot.com/t/problems-sending-post-requests/15586/2 "2019-08-04T12:42:25Z")

</div>

I found a solution  
 ![16x16_smiley-wink.png.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/5/550f65d2f3384e5c8911d89f2498aa3ac2203a21.png)

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [August 5, 2019, 5:20pm UTC](https://community.hubspot.com/t/problems-sending-post-requests/15586/3 "2019-08-05T17:20:34Z")

</div>

Welcome, @swoop.

Thanks for contributing; I’m glad you resolved the matter!

Would you mind briefly describing the solution you found?

If other Community members encounter a similar issue, I’d love to be able to direct them to your post  
 ![16x16_smiley-very-happy.png.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/a/a83ec960612094a57cfb392e21c202c8e77b967c.png)

---

<div class="post-metadata">

**Author:** ![somespec](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/somespec/32/30597_2.png) [@somespec](https://community.hubspot.com/u/somespec)\
**Post date:** [September 3, 2020, 3:46am UTC](https://community.hubspot.com/t/problems-sending-post-requests/15586/4 "2020-09-03T03:46:14Z")

</div>

so what is the solution please share it here .. thanks !

---

<div class="post-metadata">

**Author:** ![Vchannel](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/vchannel/32/31184_2.png) [@Vchannel](https://community.hubspot.com/u/Vchannel)\
**Post date:** [August 20, 2021, 6:22am UTC](https://community.hubspot.com/t/problems-sending-post-requests/15586/5 "2021-08-20T06:22:04Z")

</div>

Hi swoop,

I am also getting same issue can you tell how should i slove this.

---

<div class="post-metadata">

**Author:** ![ABENMALEK](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/abenmalek/32/28756_2.png) [@ABENMALEK](https://community.hubspot.com/u/ABENMALEK)\
**Post date:** [March 9, 2021, 2:38pm UTC](https://community.hubspot.com/t/problems-sending-post-requests/15586/6 "2021-03-09T14:38:36Z")

</div>

How did you solved your probem please @swoop ?
