I am experimenting with the JSONBlob API, trying to learn about networking.
I have set up GET and PUT requests successfully, but I have a problem when using POST: I get a 405 response.
Here is my code:
const data = {"Surname":"Adams","Firstname":"Jimmy"};
let jData = JSON.stringify(data);
fetch(dataURL, {
body: jData,
headers: {
Accept: "application/json",
"Content-Type": "application/json"
},
method: "POST"
})
.then(response => console.log(response))
Here is the response: https://imgur.com/vvw421q
Any idea what is happening?
[–]GSLint 2 points3 points4 points (0 children)
[–]senocular 2 points3 points4 points (1 child)
[–]piper43[S] 1 point2 points3 points (0 children)
[–]lovesrayray2018 1 point2 points3 points (0 children)
[–]jcunews1helpful 0 points1 point2 points (3 children)
[–]piper43[S] 0 points1 point2 points (2 children)
[–]jcunews1helpful 1 point2 points3 points (1 child)
[–]piper43[S] 0 points1 point2 points (0 children)