WebStorm Creating two URLs in header
已回答
When trying to send data to an api the data is instead sent to localhost creating a 404 error, and for some reasons there are two URLs in the Header.
I'm trying to use fetch / post, to send form data to a swagger api hosted by my university. Unfortunately, when I click send the data is sent to localhost instead of the provided https path.
I have changed the port to 8080, allowed unsigned requests and the accepting of external connections.
The code is still being sent to http://localhost:8080/ which produces a 404 error.
What do I need to do to send the data to the correct destination? Why are there two URLs in my Header?
Below you can see my code used to try to send the data.
fetch('https://correct-path.com/api/v1/data', {
method: 'POST',
headers: {
Authorization: 'TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
});
Screenshot of the Header and the logged network error:

请先登录再写评论。
Hello, Andereanewsletters. Could you please describe in more detail how exactly I can reproduce the issue on my side? Is it possible to share a sample project?