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.
Hi AdamFry
We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet.
In case if you have any resolution please do share that same with the community as it can be helpful to others.
Otherwise, will respond back with the more details and we will try to help.
Thanks.
Thank you for checking back on this. I am trying to exercise the web activity to get the API reponse headers and I wonder if I'm overcomplicating this whole thing. Based on what I'm seeing, I'm wondering if the fabric REST and/or WEB connection handles URL redirects automatically?
The API I'm calling requires me to get a URL redirect by calling one URL and on that call, I get an HTTP 302 response with a "Location" field in the response header that provides me the URL that I should call to get my data. Then I need to call another URL to get a token and pass that into the 3rd request at the redirected URL.
When I try using the web connection and point to the first URL with anoynmous authentication, I get a 401 Unauthorized back saying the client request has not been completed because it lacks valid authentication credentials for the requested endpoint(url).
However, when I make this same call via Postman with no authentication provided, I get the HTTP 302 and the redirect URL in the response headers.
As a test, back in Fabric, I tried adding my token URL and API credentials to the web connection and then instead of getting the HTTP 302 and the redirect URL in the response headers, I got the content that I normally would get on the final call. This makes me think that Fabric is automatically handling the redirect and I don't need to bother with the web call and parsing the redirect URL from the response and then making another request to get the data.
Is there any documentation that describes this behavior? I just want to confirm that the REST connection is actually automatically following the redirect and if that's the case, that's awesome and I can simplify my pipeline.
- v-cboorla-msft2 years ago
Microsoft Employee
Hi AdamFry
Apologies for the issue you are facing.
At this time, we are reaching out to the internal team to get some help on this .
We will update you once we hear back from them.
Appreciate your patience.Thanks.
- v-cboorla-msft2 years ago
Microsoft Employee
Hi AdamFry
Apologies for the inconvenience.
Please reach out to our support team to gain deeper insights and explore potential solutions. It's highly recommended that you reach out to our support team. Their expertise will be invaluable in suggesting the most appropriate approach.
Please go ahead and raise a support ticket to reach our support team:
https://support.fabric.microsoft.com/support
After creating a Support ticket please provide the ticket number as it would help us to track for more information.
Thank you.
- v-cboorla-msft2 years ago
Microsoft Employee
Hi AdamFry
We haven’t heard from you on the last response and was just checking back to see if you've had a chance to submit a support ticket. If you have, a reference to the ticket number would be greatly appreciated. This will allow us to track the progress of your request and ensure you receive the most efficient support possible.
Thanks.