ADF copy activity to read post api request

arkiboys 9,706 Reputation points
2024-02-08T17:32:43.9833333+00:00

Hello, Using the copy activity, in source, I created a source dataset to read the api post... In the request method I selected post in the request body I added the parameters the api is expecting I now can read json data. Question: Instead of adding parameter to the Request Body, how is it possible I pass these parameters into the REST source dataset instead? Please note, for my other projects I used GET as request method and I was able to add parameters into the dataset but it seems if the request method is POST then even if you add parameters to the dataset then it gives error and the only way post works seems to be by adding the parameters to the Request Body and NOT the dataset. Can you confirm? Thank you

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,444 questions
0 comments No comments
{count} votes

Accepted answer
  1. Richard Swinbank 527 Reputation points MVP
    2024-02-08T18:49:11.4966667+00:00

    That’s correct. Passing the parameter in a GET request only happens to be possible because HTTP GET accepts data in the URL query string rather than the request body.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Richard Swinbank 527 Reputation points MVP
    2024-02-08T17:55:20.6233333+00:00

    POST requests send data in an HTTP request body by design (https://en.wikipedia.org/wiki/POST_(HTTP)) -- that's a feature of the HTTP protocol, not a design choice made by ADF.

    ADF supports choosing between HTTP verbs (e.g. GET vs POST) in the Copy activity itself -- you can't make GET/POST behaviour a parameter of a dataset or linked service, so you can't make the POST request body a parameter either.


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.