Forum Discussion
Getting REST response headers
- 2 years ago
I hate to tag the response to my own question as the solution but I was able to get a response on my support ticket that in fact. This is all I was trying to do with getting the REST response headers was to get a handle on the redirect URL but it turns out it's much simpler than that and I don't even need to bother with it:
... the Fabric REST connection functionality does handle URL redirects automatically. When you configure a REST connection in Fabric, it should follow the redirection and retrieve the data from the final URL.
Thank you, I have submitted a support ticket with the following support request id:
2405100040007201
I posted on the fabric community forums and was directed to create a support request to see if I could get some help understanding the best practice for making a REST API call to a URL that uses URL redirection. Here's my original post: https://community.fabric.microsoft.com/t5/Data-Pipelines/Getting-REST-response-headers/m-p/3904046/highlight/true#M3171 To take a step back and provide some context for the question, I have a 3rd party system that has some of my company's data and I would like to bring that data into Fabric. The data is accessible via REST API. The API uses HTTP Redirects so I am to call one URL that will never change and that URL will provide me with an HTTP 302 response with a Location field in the response headers and that Location field contains the URL that I should call to make the request for my data. My question is whether this is automatically built into the REST connection functionality in Fabric or if I need to call the first URL, parse the redirect location from the response header, and then make the call to the redirect URL. When I tried calling the first URL to get the redirect from the Fabric pipeline, I would get a 401 unauthorized response saying the client request has not been completed because it lacks valid authentication credentials for the requested endpoint (url). When I make the same request via postman, I get an HTTP 302 and the redirect URL in the response headers. When I add the token URL and the API credentials and point to the 1st URL in fabric, instead of getting the 302 and redirect location, I actually got the data back that I had expected to get on the 2nd request. So I suspected that Fabric is automatically handling the URL redirection but I wanted to be sure and so I made the forum post to ask if there is any documentation to confirm this is the case.
I hate to tag the response to my own question as the solution but I was able to get a response on my support ticket that in fact. This is all I was trying to do with getting the REST response headers was to get a handle on the redirect URL but it turns out it's much simpler than that and I don't even need to bother with it:
... the Fabric REST connection functionality does handle URL redirects automatically. When you configure a REST connection in Fabric, it should follow the redirection and retrieve the data from the final URL.