Home > Back-end >  http response is 500 on code parameter request
http response is 500 on code parameter request

Time:09-28

This is a http request to the https://auth.monday.com/oauth2/authorize endpoint on asp.net 6. It should get the code parameter from that endpoint but it's returning a 500 response with html for some reason. This is part of my code grant flow because the API has oauth2.0.

public async Task<string> GetCode(string clientId, string redirect_uri)
    {
        HttpClient client = new HttpClient();    

        HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, $"https://auth.monday.com/oauth2/authorize{clientId}");


        string json =
            JsonSerializer.Serialize(
                new
                {
                    query = "code"
                }
            );
        request.Content = new StringContent(json,
            Encoding.UTF8, "application/json");

        var response = await client.SendAsync(request);
        var responseText = await response.Content.ReadAsStringAsync();
        return responseText;
    }

CodePudding user response:

Are you missing a / in your endpoint by any chance? Should it not be https://auth.monday.com/oauth2/authorize/{clientId}?

CodePudding user response:

HTTP 500 is an internal server error, this means that the server was unable to handle your request properly. If you have access to the server then I would look there as to why it was unable to handle your request. I don't see anything wrong in your request.

  • Related