0

I am getting expected response while doing HTTP get a request through an authorized browser window, but I receiving 404 - project not found response while trying to do the same HTTP request from the private browser window or browser window that is authorized by another account. I am using Google Chrome Browser, I am receiving the same 404 response when I try to make a request using node.js npm gitlab package.

http://:mydomain/api/v4/projects/:projectID/repository/commits/dev/diff?authorization:Bearer%myAccessTocken&format=json&Content-Type:application/json

when I make this request in the authorized browser, I received diffs of the last commit made in dev branch, but when I make the same request in private window, I receive 404.

I guess I need to pass some additional headers or parameters to request. How can I fix this?

Armali
  • 18,255
  • 14
  • 57
  • 171

1 Answers1

0

can't really give you an answer with that information, but i noticed that your query string should not be a query string but be the header. (authorization is not passed as an argument but as a header) also check your route if it can pass a query string

Eassa Nassar
  • 700
  • 9
  • 15
  • Thank you, that helped a lot, I thought the request was valid because it was giving me a result, but I never tried to make same request without 'authorization' argument. I tried now and it still gave me the result. so I just modified my request and instead autorization:Bearer myAccessToken, I passed access_token=myAccessToken as a parameter(found it in documentations of gitlab API), now this works fine – Temirlan NURMAMATOV Jan 29 '19 at 11:14