Azure / Azure/Azure-DataFactory

Rest connector not working for POST method when authorization header and content type are set in additional headers.

Open
#170 9 comments 0 reactions 0 assignees View on GitHub
Dominant language
PowerShell
Stars
529
Forks
623
PR merge metrics
No merged PRs in 30d

Description

I am trying out Data Factory to ingest data from Rest endpoint to DataLake. Tried out Get method after setting authorization Bearer in additional headers and it worked.
Post method is not working when I set authorization Bearer token and content type.
PFB details.
I have set 1) request body contents 2) Content-type as application/json and authorization Bearer token in additional headers.
I get a error response when I click on Preview Data button- Your request was made with invalid credentials. If I click on same button once again, then I get data validation failed error.
Same request is working from postman ..
Details of data factory - ADF v2. I am using a REST connector.

1) Rest endpoint which I am trying out - https://gorest.co.in/rest-console.html
**POST** - https://gorest.co.in/public-api/users
Bearer token gets expired for this endpoint from time to time, so I change the token for rest source in datafactory. Even then this is not working.
**sample request** -
{
"first_name":"jijo",
"last_name":"thomas",
"email":"jijovayalumkal28@gmail.com",
"gender":"male"
}

2) Tried out Get endpoint from datafactory and it worked.
**GET** - https://gorest.co.in/public-api/users

3) Also I tried a different endpoint which does n't require any bearer token for post method. It also worked from data factory.

Please let me know if I am missing anything here.

![PostMethodDetails](https://user-images.githubusercontent.com/56118477/78010365-ea681b00-735f-11ea-844a-a267faa213cf.jpg)
![postmanRequest](https://user-images.githubusercontent.com/56118477/78010418-f9e76400-735f-11ea-8974-715a71e4e287.jpg)
![RestSource](https://user-images.githubusercontent.com/56118477/78010671-4632a400-7360-11ea-9db7-43fc4966bce0.jpg)
![ErrorOnPreview](https://user-images.githubusercontent.com/56118477/78010695-4e8adf00-7360-11ea-8589-aa3cdaa0869e.jpg)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.