Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Rewrite mastodon-http--get-json to return a list including header info #187

Open
alexjgriffith opened this issue Mar 10, 2018 · 0 comments

Comments

@alexjgriffith
Copy link
Collaborator

mastodon-http--get-json currently returns a vector, it can be adapted to return a list.

While these changes are being made I recommend adding header info to the output. This will be required for allowing nav in favourites and other timelines that are sorted using an internal key. Something like:

'((("Server" ."Mastodon")
   ("Link" "<https://mastodon.social/api/v1/favourites?max_id=6987771>; rel=\"next\", <https://mastodon.social/api/v1/favourites?since_id=7010142>; rel=\"prev\")
    ... )  
  . (Body-ElementA Body-ElementB ...))

From documentation
Note: max_id and since_id for next and previous pages are provided in the Link header. It is not possible to use the id of the returned objects to construct your own URLs, because the results are sorted by an internal key.

HTTP/1.1 200 OK
Date: Sat, 10 Mar 2018 18:58:37 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Server: Mastodon
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
X-RateLimit-Limit: 300
X-RateLimit-Remaining: 298
X-RateLimit-Reset: 2018-03-10T19:00:00.411404Z
Link: <https://mastodon.social/api/v1/favourites?max_id=6987771>; rel="next", <https://mastodon.social/api/v1/favourites?since_id=7010142>; rel="prev"
Vary: Accept-Encoding, Origin
Content-Encoding: gzip
ETag: W/"e11011ad7071cbd13fea1f37aaeeaf18"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 466b636a-9c5a-4bb6-9e06-cf6b42c5ab4f
X-Runtime: 0.152353
Strict-Transport-Security: max-age=31536000

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants