Huachao / vscode-restclient

REST Client Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=humao.rest-client
MIT License
5.24k stars 436 forks source link

incorrect response downloading report from amazon advertising api #486

Open lincolnaleixo opened 4 years ago

lincolnaleixo commented 4 years ago

Steps to Reproduce:

  1. Tried to execute a curl or request to download a file from amazon advertising API
curl --request GET \
  --url https://advertising-api.amazon.com/v1/reports/amzn1.clicksAPI.v1.p1.xxxxx/download \
  --header 'amazon-advertising-api-clientid: xxxxxx \
  --header 'amazon-advertising-api-scope: xxxxxxx \
  --header 'authorization: Bearer xxxxxxxxxxxx \
  --header 'content-type: application/json'

or

GET {{reportLocationUrl}}
Authorization: {{authorization}}
amazon-advertising-api-scope: {{apiScope}}
amazon-advertising-api-clientid: {{clientId}}
  1. Got
HTTP/1.1 400 Bad Request
x-amz-request-id: 4F1B5ACD8107D2D4
x-amz-id-2: R3UjUVDooN2fsv1hJOuLPXC6ad/RHCZC/f8wsrdyTeJmEiNbNtm1veOa9HFdG6yjQYGmVNjzXDw=
Content-Type: application/xml
Transfer-Encoding: chunked
Date: Wed, 15 Jan 2020 21:38:13 GMT
Connection: close
Server: AmazonS3

<?xml version="1.0" encoding="UTF-8"?>
<Error>
  <Code>InvalidArgument</Code>
  <Message>Only one auth mechanism allowed; only the X-Amz-Algorithm query parameter, Signature query string parameter or the Authorization header should be specified</Message>
  <ArgumentName>Authorization</ArgumentName>
  <ArgumentValue>Bearer xxxxxxxxx</ArgumentValue>
  <RequestId>4F1B5ACD8107D2D4</RequestId>
  <HostId>R3UjUVDooN2fsv1hJOuLPXC6ad/RHCZC/f8wsrdyTeJmEiNbNtm1veOa9HFdG6yjQYGmVNjzXDw=</HostId>
</Error>
  1. I tried the exact same request on imsomnia , postman and terminal (using output to choose location). All previous works perfectly (imsomnia and postman I need to save the body after the request , what is the correct response)
Huachao commented 4 years ago

@lincolnaleixo could you please provide the output with curl -v for the above successful request?