Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
JonasValleskog
Partner - Creator
Partner - Creator

How to resolve 301 redirects with Qlik Sense REST connector?

I'm trying to pull data from GitHub via the standard Qlik Sense REST connector. Some repositories can be moved over time, and for those repositories - a 301 redirect is received. However. Whilst tools like Postman is able to automatically resolve the redirect and successfully return the end result from the redirected URL - The Qlik Sense REST connector does not seemingly handle it gracefully (or I'm just configuring it incorrectly).

I can successfully pull data from a github repo, but for any redirected repos - I get a 401 "Unauthorized" back. That looks plain wrong. I'm authenticating via personal token, using the header "Authorization" "token <mytoken>" syntax, which clearly works as it's pulling data successfully for everything apart from redirected URLs.

How do I configure the REST connector to resolve redirects?

The QvRestConnector.exe.config setting for AllowAutoRedirect = true.

<appSettings>
<!--<add key="InstallationMode" value="Enterprise Desktop" />-->
<add key="InstallationMode" value="Enterprise"/>
<add key="CertificateDirectoryPath" value="C:\ProgramData\Qlik\Sense\Engine\Certificates"/>
<add key="AllowAutoRedirect" value="true"/>
</appSettings>

The configuration options in the REST connector seem non-existent and I haven't found any posts on the forum covering this topic.

Ps. The REST connector log is not divulging anything of use, even if set to info level ALL. Surprisingly (to me) it does not capture anything about the actual message traffic. So, from what I can tell, the message traffic is logged nowhere at all.  Makes it impossible to debug or to do historical analysis of REST connector web traffic from the logs. Ds.

Any help much appreciated!

Example 301 response header

Location: https://alm-github.blah.blah/api/v3/repositories/123456

Example 301 response body

{
"message": "Moved Permanently",
"url": "https://alm-github.blah.blah/api/v3/repositories/123456",
"documentation_url": "https://docs.github.com/enterprise/3.1/v3/#http-redirects"
}

Version of QvRestConnector = 2.82.0

 

Labels (1)
1 Reply
Francisco_Fernandez

Hello @JonasValleskog ,

Could you please let me know what happens if you try the same request using Curl? Do you get the same result?

Also, what kind of request are you using a Get?

Best regards,

Francisco