... when using - X-Direct-Download
Hi,
I'm using the Extractions/RawExtractionResults method with X-Direct-Download set to true to try to get a 302 redirect to the AWS S3 link. I have tried this using Postman and .Net Core. I have followed the guides at:
private HttpClient Client = new HttpClient(new HttpClientHandler
{
AllowAutoRedirect = false,
});
var uri = new Uri($"https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/RawExtractionResults('{job.JobId}')/$value");
var request = new HttpRequestMessage(HttpMethod.Get, uri);
request.Headers.Add("Authorization", $"Token {authToken}");
request.Headers.Add("Prefer", "respond-async");
request.Headers.Add("X-Direct-Download", "true");
var result = await this.Client.SendAsync(request);
I expect result to have a 302 status code with the redirect to the S3 bucket in the header but it always has a 200 with the actual data. I have also tried using postman with automatic redirects turned off.
UPDATE
I want to clarify what I am trying to achieve and the steps I am following:
1) Get Authentication token using /Authentication/RequestToken endpoint and username/password - no issues.
2) Use the token to get a list of completed jobs from the /Jobs/JobGetCompleted endpoint - no issues.
3) Use a job ID obtained in step 2) to get the extraction data from using the Extractions/RawExtractionResults endpoint. This is where I am having issues. The endpoint gives a 200 response and returns the data which is what I would expect. The problem is when I try to use the "X-Direct-Download" header. I still get a 200 response and the data rather than a 302 redirect.
This happens when auto redirects are turned off in Postman and when redirects are disabled in C# as in the code sample above.