Request does not work correctly
Hey. I am using ky and react query. Locally in my Docker container. Everything works fine. My backend gets the request and processes it. As soon as my Webinterface is in a docker container on my server and online....This one endpoint does not work anymore. I have about 15 endpoints.....1 of them (its always the same one) does not work correctly if the webinterface is online. If I send my request via PostMan it does work without any problems (also with the same JSON).
My onSubmit does work without any problem...The body is also the right one.
This is how my insertSupportOption works
This is my api variable.
Do you guys see anything why this one endpoint does not work only if it is online?
14 Replies
deep-jadeOP•3y ago
This is my API framework
deep-jadeOP•3y ago
GitHub
GitHub - sindresorhus/ky: 🌳 Tiny & elegant JavaScript HTTP client b...
🌳 Tiny & elegant JavaScript HTTP client based on the browser Fetch API - GitHub - sindresorhus/ky: 🌳 Tiny & elegant JavaScript HTTP client based on the browser Fetch API
rising-crimson•3y ago
What error are you exactly getting?
deep-jadeOP•3y ago
No error
THATS the problem
There is no error
I have a console log in my backend which should print after the backend gets a request
But it does not
So my Frontend does not send anything
exotic-emerald•3y ago
If you look at the query in the network tab of the devtools, what's the difference with the one that works in postman?
deep-jadeOP•3y ago
Fun fact. I don’t see a query which is going out. I only see the response on my local Webinterface.
wait
let me take a look again
deep-jadeOP•3y ago
This is the response on my online webinterface

deep-jadeOP•3y ago
Sry its german.
deep-jadeOP•3y ago
This is how it should look like

deep-jadeOP•3y ago
My backend is not responding on the online webinterface. But if I send a request manually it does respond.....hm
exotic-emerald•3y ago
CORS issue maybe?
deep-jadeOP•3y ago
But why should CORS make a problem on only one endpoint? The other endpoints work well
And they are built the same
Is it normal that it is not shown that this is a POST on my online version?
on my local version it is shown in pink
The cookie is also missing
CORS would kill all endpoints wouldnt it?
Every endpoint works well except this one...And my server is not responding in my network tab. With Postman it is reachable
exotic-emerald•3y ago
not sure. You can also try sending the request using
fetch() directly from the console to see if it works. Is there any error in the browser's console? Does your server receive anything (is there any log)?deep-jadeOP•3y ago
I only have a println in my backend so it should send something into the console if that endpoint gets triggered... Uhm how do i send such a request using fetch in the console?
It just told me that there is no cookie
If you compare both requests you can see that the first one on my online Webinterface does send a completely different request than my local version (2nd one)