In my freelance job, I have tasked which I need to call the API using curl. I don't have any much knowledge of it but I think I got some idea.
Basically, the API is called by a PDA mobile device where a user can enter the information and will send through JSON format and call the API.
But the API call will not always return success. The first task which I want to do is to store that raw json into the server, which I already finish implemented.
The second one is to call the API through curl and passing the failed raw JSON. So before will run the curl, a user who only has SSH access to a server can able to edit the raw JSON and run curl to call API with edited raw JSON.
here's the curl syntax:
curl -vX POST http://206.189.159.4:8080/chicken/api/order/create -d @json/20181008-180947_PDA_1.json --header "Content-Type: application/json"
let me explain more:
-v = verbose
X = request
-d = data json file (i don't know why there is @ at the beginning)
--header "Content-Type: application/json" = i think its understandable as we pass json file here
Eureka!
Subscribe to:
Post Comments (Atom)
free online comma separating tool
https://delim.co/#
-
In my current company, I'm using Visual Paradigm for my documentation task. If you go there site, you can either download community and ...
-
One of the functionality in our system is can able to generate a report using Jasper report. We have a Jasper server setup in another ip ad...
-
This issue happens when I installed Postgres in my vagrant (vm) and then I after a while I removed it. But the service is still running in t...
No comments:
Post a Comment