Closed ILoveHubGit closed 5 years ago
Hi, sorry it's taken so long to reply. You shouldn't need to set the Accept header because the response format should do that for you. (And that might be what's happening with the first example.) Other than that.. I'm afraid I'm not sure. I'm not sure what method you're using as well: are you using POST
or ajax-request
?
Sorry from my side now for answering so late. The whole problem I had here had noting to do with cljs-ajax, this library is working fine. The problem was that the server I called did not answer correct on the OPTIONS call made by the browser. This problem is related to CORS (Cross Origin Resource Sharing). On top of this the browser I used (Brave) only handles CORS calls correct if you allow third party cookies. This has been reported as a bug at Brave. Thanks for the reply.
I'm trying to call an API that requests a custom header parameter, but I don't know how to add this. If I'm using this:
I see a header parameter: Accept: application/json But if I try this
I get:
Access-Control-Request-Headers: Custom
Instead of:
The value does not appear and the server can't answer my request due to malformed request.
What am I doing wrong?