Unsupported content type c#


#1

Hi, getting the response “unsupported content type” when making a request.

Working with C#:

public static IRestResponse Meetings()
{
    RestClient client = new RestClient();
    client.BaseUrl = new Uri("https://api.zoom.us/v2");
    RestRequest request = new RestRequest();
    request.AddParameter("userId",
        "support@oltinternational.net", ParameterType.UrlSegment);
    request.Resource = "users/{userId}/meetings";
    request.AddParameter("access_token", "my access token is put here yadda yadda");
    request.Method = Method.POST;
    var response = client.Execute(request);
    return response;
}

Response is “unsupported content type”, the content type is application/json .

Any help would be great.


#2

Hi @oltinternational,
Have you tried the same payload using Postman or Curl to see if it works? The content-type application/json should work.

Thanks


#3

Hi Michael, thanks for the reply but there’s not much point in me testing it using Postman/Curl because i can only use C# in this instance to retrieve the data I need.

Can you offer a C# solution please?
Thanks.


#4

Tried sending a test request on this page:

and i am met with the message “Request Body should be a valid JSON object.”, code 300


#5

Hi @oltinternational,

Usually, if you get this type of error, you have to make sure the JSON your sending is valid. Can you post the JSON so that we can take a further look?

Thanks