Questions regarding the API
Opened this issue · 1 comments
UnlimitedCookies commented
$ curl https://burner.kiwi/api/v2/inbox/ -v -L
... [truncated tls handshake]
> GET /api/v2/inbox/ HTTP/2
> Host: burner.kiwi
> user-agent: curl/7.74.0
> accept: */*
>
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* Connection state changed (MAX_CONCURRENT_STREAMS == 250)!
< HTTP/2 301
< content-type: text/html; charset=utf-8
< date: Mon, 19 Sep 2022 09:54:46 GMT
< location: /api/v2/inbox
< server: Caddy
< content-length: 48
<
* Ignoring the response-body
* Connection #0 to host burner.kiwi left intact
* Issue another request to this URL: 'https://burner.kiwi/api/v2/inbox'
* Found bundle for host burner.kiwi: 0x55da24fe0320 [can multiplex]
* Re-using existing connection! (#0) with host burner.kiwi
* Connected to burner.kiwi (54.245.58.14) port 443 (#0)
* Using Stream ID: 3 (easy handle 0x55da24fc3990)
> GET /api/v2/inbox HTTP/2
> Host: burner.kiwi
> user-agent: curl/7.74.0
> accept: */*
>
< HTTP/2 200
< content-type: application/json
< date: Mon, 19 Sep 2022 09:54:47 GMT
< server: Caddy
< content-length: 412
<
{"success":true,"errors":null,"result":{"email":{"address":"dzempcbm@spacial.autos","id":"4f287549-afc9-46ab-bcd4-54acd79a9859","created_at":1663581287,"ttl":1663667687},"token":"eyJhbGciOiJIUzI1NiJ9.eyJJbmJveElEIjoiNGYyODc1NDktYWZjOS00NmFiLWJjZDQtNTRhY2Q3OWE5ODU5IiwiX19wdXJwb3NlIjoiYXV0aCIsImV4cCI6MTY2MzY2NzY4NywiaWF0IjoxNjYzNTgxMjg3LCJpc3MiOiJidXJuZXIua2l3aSJ9.JSQZElGOWfObR8jS9aFoMjxy5XWBgE-_soNC8MOHlV4"}}
* Connection #0 to host burner.kiwi left intact
Two things I noticed:
- The response code is
200 OK
instead of the documented201 Created
- Why does the server first return an
301 Moved Permanently
to the same location it previously made a request to?
haydenwoodhead commented
The response code is 200 OK instead of the documented 201 Created
Good spot. Feel free to open a pr with a fix to either the code or the docs.
Why does the server first return an 301 Moved Permanently to the same location it previously made a request to?
I suspect it's moving you from a trailing "/" to a URL without a trailing "/".