question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provide HttpHeaders (Authorization) for XMLPolyDataReader.setUrl()

See original GitHub issue

Hi,

I’m using XMLPolyDataReader to read a PolyData XML file from a API. That works fine when the API method is accessible without authorization. But we need to provide a access token for the API by setting the Authorization field in the HTTP header.

Is that possible?

At the moment I use the XmlPolyDataReader like this:

  public addModelFromUrl(url: string) {
    const reader = this.vtkXMLPolyDataReader.newInstance();
    reader.setUrl(url).then(() => {
      const modelPolyData = reader.getOutputData(0);
      ...
    });
  }

Thanks!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
goflocommented, Apr 2, 2020

I solved the problem. Encoding of the Base64 was wrong. I used now ASCII Encoding and it works now 😊

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sending GET request with Authentication headers using ...
HttpHeaders headers = new HttpHeaders(); headers. ... getAuthorization() and then populating the header, with null checks as appropriate.
Read more >
Using the Authorization Header (AWS Signature Version 4)
Using the HTTP Authorization header is the most common method of providing authentication information. Except for POST requests and requests that are signed ......
Read more >
Authorization and HTTP Headers | Google Ads API
You need both OAuth 2.0 application credentials and a developer token when calling the Google Ads API. If you're making API calls as...
Read more >
Basic Authentication with the RestTemplate - Baeldung
In this tutorial, we'll learn how to use Spring's RestTemplate to consume a RESTful Service secured with Basic Authentication.
Read more >
HTTP headers and query string parameters for XML API
In response to a Cookie-based authentication request it provides you with a unique web origin response URL for the request. In response to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found