I am new to working with API and was given an assignment to get response data from the API in ReactJS.
The API given to me is this:
To get the response from it I have tried this method and I'm not able to get the response from the API after posting data.
I think I might have been doing the mistake with sending the request using the inputs.
Is anyone aware of what exactly my mistake in getting the response from API and guide me solve this issue I'm facing with it.
Whatever ideas you feel that can be of help to me feel free to assist me. I'll give my sandbox link to further code reference of what I have done and ask me if anything you need regarding the code.
https://codesandbox.io/s/qr-menu-smvr6h?file=/src/Login.js
I think the mistake I have done is when I'm sending the post request to the API with the input parameters.
Related
I am trying to access profile API from my backend using fetch requests in react. But I get server errors all the time. it seems the backend does not recognise that I am logged in though login request works fine. I really need help with this. Been stuck for weeks. Aall the necessary code and errors are in the link below since I asked this question some time ago but couldnt get an answer. Thank you in advance.
previous question
I'm having troube with my post request, for some reason it doesn't seem to be sending the data its supposed to. When I submit the request I get a status 201 which is great but when I check the https://jsonplaceholder.typicode.com/posts the post I send doesn't come up.
Here is my code, I have recreated it in a sandbox.
https://codesandbox.io/s/objective-thunder-322xi?file=/src/components/FormComponent.js
Can someone help me out please, thank you?
The JSONPlaceholder guide state that you will get the correct response, but data will not be persisted.
Important: the resource will not be really updated on the server but it will be faked as if.
(source: https://jsonplaceholder.typicode.com/guide.html)
To actually save your data you need to create your own copy of the service. For this use: https://github.com/typicode/json-server.
when I hit the API and after this, I got the response in JSON format while using the Postman tool,
I want all of that response come in array
is that possible?
if, yes, please tag the solution
I know there are lot of questions similar to this, but no one helped me.
I have to make a C program, using socket and no external lib, that sends an HTTP POST request to a web server and manage its JSON answer.
The URL is like this:
meswebapptest.hermanmiller.com/mes/rest/r2Label/print/userId/company/unitId/prodOrder/printer
i.e.
meswebapptest.hermanmiller.com/mes/rest/r2Label/print/Biesse/105/1B6D0X-----11225105/112251/Q0161B8
So my question is: How the string should be formatted to match that URL?
Thanks in advice.
I'm getting CORS error while trying to get some data through Spotify's Open APIs such as API/v1/search?type=album&q=... and API/v1/albums/{id} in a Simple Angular 4 Application that searches for albums with a Query then tries to show that specific album Information.
I assume that these two APIs are open and don't need any kind of authorization. So How can I get data from these two when there's no JSONP method available without getting CORS error and without Authorization?
Passing client_id doesn't help I'm afraid.
As no one posted a proper answer, I ended up writing and using a simple wrapper over Spotify's API. Everything's working now! No more darn CORS errors or anything! :)