Deepak Kumar
Deepak Kumar

Reputation: 61

The Format of Body for a POST request in Web Activity in Azure Data Factory

I have created a web activity in azure data factory pipeline which have only one header and I have to pass body for a POST request. I have tried passing body as JSON and as String also but the request failed with "Invalid Query". Can anyone please tell me how can I send a POST request from azure data pipeline with additional header and body. I have multiple key value pairs to pass to body.Check the Screenshot of web activity

Upvotes: 2

Views: 12720

Answers (2)

I've got the same issue. However, my API doesn't have authentication and it was expected to result on an access_token. But I always get the error below, no matter how I try to set my Web Activity.

Error details

I'm using the following settings.

Web activity settings

Already tried using "&" between properties, using ","... nothing works. Always the same result.

Calling the same API through Postman, with the same input parameters, works fine.

Postman request

Upvotes: 0

GregGalloway
GregGalloway

Reputation: 11625

Please try this. First, add one more header with Name of Content-Type and value of application/x-www-form-urlencoded

Then change the Body to:

grant_type=password&username={username}&password={password}&scope=customer-api

Upvotes: 8

Related Questions