Is it possible to create a HTTPS GET request with body param?

andrie 41 Reputation points
2021-05-27T11:12:54.723+00:00

Hi, I need to make a HTTP GET request with a body param, because it will be used for filter, is there a way to do it in api management?

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
2,457 questions
0 comments No comments
{count} votes

Accepted answer
  1. MayankBargali-MSFT 70,941 Reputation points Moderator
    2021-05-27T13:30:58.587+00:00

    Hi @andrie

    Welcome to Microsoft Q&A! Thanks for posting the question.

    Unfortunately, this is not possible as APIM uses .NET objects (Http Proxy) to connect to backends and these cannot bypass RFC compliance requirements. If for example, you try to send a GET with a body, there won't be any errors but the GET will be sent to the backend without the body.

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Michael Taylor 60,331 Reputation points
    2021-05-27T13:53:16.587+00:00

    GET requests are not allowed to have a body per the HTTP standard. APIM is irrelevant here as it is a standard thing.

    Note that it is possible as you can send anything you want in an HTTP request. Even worse is that it might actually work if you happen to be testing this on your local web server instance. However since the standard does not allow it then there are no guarantees it'll actual work in all cases. If there is any proxy between you and the remote web server (such as a company proxy, Internet backend server, etc) then they can and usually will ignore the body on GET requests (because they will be repackaging the request). Hence you may see it work in some cases and not others. The standard says no so you shouldn't do it.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.