Skip to content
Snippets Groups Projects

Extend authorization: update docs and help

Merged Hahn Axel (hahn) requested to merge extend-authorization into master
1 file
+ 25
0
Compare changes
  • Side-by-side
  • Inline
+ 25
0
@@ -164,3 +164,28 @@ http.setAuth
http.makeRequest GET "api"
http.makeRequest GET "app"
```
## Gitlab access token
Gitlab uses the value `PRIVATE-TOKEN: <token>` in the request header for authorization.
Here we need `http.addHeader` to add a custom header line.
```sh
URL='https://gitlab.example.com/api/v4'
TOKEN='<add-your-token-here>' # glpat-**********
# ---------- init
http.init
http.addHeader "PRIVATE-TOKEN: $TOKEN"
http.setBaseUrl "$URL"
# ---------- Requests to api
http.makeRequest /users
http.getResponse | jq
http.makeRequest /projects
http.getResponse | jq
```
Loading