0
votes

I added API operation and mentioned the body content-type is application/x-www-url-form encoded. I have added the representation as shown in the image.When I try the operation in the Developers portal it is sending the request parameters in the body not in the formData.

enter image description here

How can I configure to send the parameters in formData? Thanks.

1

1 Answers

1
votes

Representation always specifies data sent in body of HTTP message, and content-type specifies it's format. Given that Azure API Management service does no processing on representation sample you specify you should always set sample to correspond to the content type you've specified.

In the example above you've used application/x-www-form-urlencoded, so more appropriate form of representation sample would be:

[email protected]&password=123456

Such operations should use POST verb and sends data in message body.

If you want to specify operation that accepts data in query string, like

http://some.domain/user/[email protected]&password=123456

you should use Parameters section and a GET verb. If you want to allow both - you have to create two operations.