I tried to connect a REST API using the postman and it's always a good request. No problems.
But, in the rest implementation code I always receive the error "StatusCode: Unauthorized, Content-Type: text/plain; charset=utf-8, Content-Length: 0)".
I've tried many ways to do this but it never done.
//url = url server
//authorization = Bearer .....
//body = text json
var client = new RestClient(url);
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", authorization);
request.AddParameter("application/json", body, ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
var result = response.Content;
In the postman
The server doesn't receive the Authorization token when I try to do it in the code.