Good Day all,
not sure what i am missing but finding it impossible to return even a simple JSON from a Curl Request.
for instance if i send a cURL Request
curl -X POST “https://victorrose.backendless.app/api/services/TractorTracking/UpdateTracking” -H “Content-Type: application/json” -d “{"Name":"Test Value"}”
and have the service simply do the following
It returns null, am i missing something obvious.
Kind Regards,
Raymond
Hi Raymond,
Have you confirmed that the method is being invoked? You could do that by adding a print
block and checking for its output using Real-Time Logging
.
Regards,
Mark
Good Morning @mark-piller ,
Thank you for your response the Method is definitely being invoked however in no instance am i able to retrieve the body containing -d “{"Name":"Test Value"}”
returns null
returns
it seems as if the data json is either not being sent or it is not being parsed on the server side.
this is the cmd prompt i am using
C:\Users\27764\Desktop>curl -X POST “https://victorrose.backendless.app/api/services/TractorTracking/UpdateTracking” -H
“Content-Type: application/json” -d “{"Name":"Test Value"}”
Yet again not sure if i am missing anything.
KInd Regards,
Raymond
Hi @Raymond_Woodley,
Below I have attached screenshots that show how you can add a post request parameter. After which this parameter will appear in the context of this method.
Regards,
Sergey
Thank you @Sergey_Androsov, working as expected now.
1 Like