reactjs - AJAX posting issue in React JS -
i have been doing react js while, front-end. spice external data. tried axios / fetch unfortunatelly both of them produced miserable result. here challenge:
fetch("http://localhost:8080/backend/datatest/src.json", { method: 'post', headers: { 'content-type': 'application/json' }, body: json.stringify({ name: 'hubot', login: 'hubot', }) }) fetch('http://localhost:8080/backend/datatest/src.json') .then(function(response) { return response.json() }).then(function(json) { console.log(json) })
its basicly copy-paste github of fetch, assuring nothing go badly. "get" function works perfectly, got problems post-ing. keep getting same error mesage
post http://localhost:8080/backend/datatest/src.json 404 (not found)
however! works perfectly.
i using react js, redux, node js. json file didnt installed @ server. in opinion next step.
regards, koppany
wiki
Comments
Post a Comment