[GH-ISSUE #210] I can't send POST method #76

Closed
opened 2026-03-16 13:13:08 +03:00 by kerem · 5 comments
Owner

Originally created by @turbobin on GitHub (Oct 24, 2019).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/210

hi,
I meet a strange problem, when I choose POST method to send, it always turn on OPTIONS, why ? look at the image:

image

Originally created by @turbobin on GitHub (Oct 24, 2019). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/210 hi, I meet a strange problem, when I choose POST method to send, it always turn on OPTIONS, why ? look at the image: ![image](https://user-images.githubusercontent.com/35211343/67458328-7fa40c80-f668-11e9-888a-8ca6ee17e296.png)
kerem 2026-03-16 13:13:08 +03:00
Author
Owner

@liyasthomas commented on GitHub (Oct 24, 2019):

@turbobin Thanks for reporting the bug. Sorry for the inconveniences caused. Could you please share the API endpoints so that we could run some manual tests.

We couldn't reproduce the issue with any other endpoints. Meanwhile, you can try sending requests in Content Type: application/json and see if the issue persists.

<!-- gh-comment-id:545776335 --> @liyasthomas commented on GitHub (Oct 24, 2019): @turbobin Thanks for reporting the bug. Sorry for the inconveniences caused. Could you please share the API endpoints so that we could run some manual tests. We couldn't reproduce the issue with any other endpoints. Meanwhile, you can try sending requests in Content Type: `application/json` and see if the issue persists.
Author
Owner

@NBTX commented on GitHub (Oct 25, 2019):

The OPTIONS request being sent first is a CORS preflight request that gets made automatically when POSTing data to a server. The POST request doesn't get sent as the OPTIONS preflight request is failing.

This is a 'feature' of the browser that we have no control over, so this issue will require use of the Postwoman proxy.

EDIT: You can read more about preflight requests here; https://developer.mozilla.org/en-US/docs/Glossary/Preflight_request

<!-- gh-comment-id:546330443 --> @NBTX commented on GitHub (Oct 25, 2019): The `OPTIONS` request being sent first is a CORS preflight request that gets made automatically when `POST`ing data to a server. The `POST` request doesn't get sent as the `OPTIONS` preflight request is failing. This is a 'feature' of the browser that we have no control over, so this issue will require use of the Postwoman proxy. EDIT: You can read more about preflight requests here; https://developer.mozilla.org/en-US/docs/Glossary/Preflight_request
Author
Owner

@NBTX commented on GitHub (Oct 25, 2019):

Also @liyasthomas we could perhaps try and detect this (for the purposes of prompting the user to turn on the proxy) by sending our own preflight request first if the proxy is turned off (i.e. just making a request to OPTIONS) - we'd get an 'opaque' response but it would be enough to know it's going to fail and therefore know that we need to prompt the user with a message.

<!-- gh-comment-id:546331112 --> @NBTX commented on GitHub (Oct 25, 2019): Also @liyasthomas we could perhaps try and detect this (for the purposes of prompting the user to turn on the proxy) by sending our own preflight request *first* if the proxy is turned off (i.e. just making a request to `OPTIONS`) - we'd get an 'opaque' response but it would be enough to know it's going to fail and therefore know that we need to prompt the user with a message.
Author
Owner

@liyasthomas commented on GitHub (Oct 25, 2019):

Thats doable. Now we check Access-Control-Allow-Origin: * to detect whether CORS occur or not. Think we could op for this method instead.

<!-- gh-comment-id:546332051 --> @liyasthomas commented on GitHub (Oct 25, 2019): Thats doable. Now we check `Access-Control-Allow-Origin: *` to detect whether CORS occur or not. Think we could op for this method instead.
Author
Owner

@liyasthomas commented on GitHub (Nov 7, 2019):

Closing this issues since it's a possible duplicate of #274

<!-- gh-comment-id:550953406 --> @liyasthomas commented on GitHub (Nov 7, 2019): Closing this issues since it's a possible duplicate of #274
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#76
No description provided.