View Entire Topic

Gaurav-Behl

MVP

29-08-2019

I'm unable to understand why do you want to pass postman-token in this request.

For bearer token try this --   

post.setHeader("Authorization", "Bearer " + token); 

or

httpClient.DefaultRequestHeaders.Authorization =
  
new AuthenticationHeaderValue("Bearer", "Your Oauth token");

For passing json, you have already written the code to set the body/json in HttpEntity -- post.setEntity(requestEntity);