Problems getting a Post call put together for API

I'm new to API's and having problems getting a Post call put together so that i can obtain my bearer token.
Any help on how to use httr so that I can get a post call together would be very helpful.
Below is from the developer portal of the experian sandbox which I am currently using.

"The call to get the Oauth2 token is a POST request with a Content-Type which needs to be specified as JSON;
the response will also be in JSON format:"

Request example:

curl -X POST
-d '{"username": "", "password": "YOURPASSWORD"}'
-H "Client_id: 3QC11Sm45ti8wXXxx9A5hma5XIlXXXXX"
-H "Client_secret: ipu3WXXxTExxZDXW"
-H "Cache-Control: no-cache"
-H "Content-Type: application/json"

I think your httr:POST will look something like this;

post_req <- httr::POST(
    "Content-Type" = "application/json", 
  body = '{"username": "", "password": "YOURPASSWORD"}',

Have you seen the vignettes?


Curtis, thank you very much. I'll read up on the links you included tonight.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.