postgrest-docs icon indicating copy to clipboard operation
postgrest-docs copied to clipboard

Add multiple methods of fetching data from the API

Open laurenceisla opened this issue 4 years ago • 2 comments

Currently, all of the API request examples are using CURL. More examples using Javascript libraries like axios or the fetch API would help the users implementing web apps with PostgREST (e.g. this gitter comment)

We could use code tabs with a CURL default to organize the methods.

laurenceisla avatar Jul 08 '21 18:07 laurenceisla

Great idea!

Currently, all of the API request examples are using CURL

Actually the examples are not even using CURL, just an HTTP snippet that's not easily translatable to CURL in many cases. For example, the POST/PATCH requests require extra arguments from curl.

So +1 to having a real curl snippet as the default.

steve-chavez avatar Jul 08 '21 19:07 steve-chavez

Just the current HTTP snippets plus CURL calls would be a good start.

Another advantage of having curl calls is that our references would be testable(ref https://github.com/PostgREST/postgrest-docs/issues/371).

Edit: Related to https://github.com/PostgREST/postgrest-docs/issues/349

steve-chavez avatar Jul 09 '21 19:07 steve-chavez

Closing this since we already have curl snippets https://postgrest.org/en/stable/references/api/tables_views.html.

axios or other libs are looking like much work for now.

steve-chavez avatar Jul 10 '23 21:07 steve-chavez