Jump to content
TomEd

CURL to REST Debugger

Recommended Posts

I'm trying to translate the following CURL command to the REST debugger:

 

curl -X POST "https://api.sensorpush.com/api/v1/oauth/authorize"

-H "accept: application/json"

-H "Content-Type: application/json"

-d @- <<BODY 
{

    "email": "<email>",

    "password": "<password>"

}
BODY

 

The PDF attached shows the result.  I expect the REST omission of -H "accept: application/json" is the problem but I'm not sure where to include it in the REST debugger, but there may be other issues.

 

Appreciate any insights...

REST_Debug.pdf

Share this post


Link to post

The Custom Body content doesn't look very JSON like. Try adding the brackets.

Share this post


Link to post
56 minutes ago, Uwe Raabe said:

Try adding the brackets.

@TomEd And the coma, in other words, the body should be fully validated JSON format.

Share this post


Link to post

Just an slightly related aside. You can use ChatGPT to convert a curl command to delphi code.  It is handy because a lot of REST api documentation may have a curl command for a call, but no Delphi version.

  • Like 2

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×