Display API Response JSON Test Data In a Table
Online REST API testing and prototyping resource
The URL Scheme
Response Displayed in a Table
| User ID | Firstname | Lastname | Avatar | |
|---|---|---|---|---|
| 1 | George | Bluth | george.bluth@reqres.in | https://reqres.in/img/faces/1-image.jpg |
| 2 | Janet | Weaver | janet.weaver@reqres.in | https://reqres.in/img/faces/2-image.jpg |
| 3 | Emma | Wong | emma.wong@reqres.in | https://reqres.in/img/faces/3-image.jpg |
| 4 | Eve | Holt | eve.holt@reqres.in | https://reqres.in/img/faces/4-image.jpg |
| 5 | Charles | Morris | charles.morris@reqres.in | https://reqres.in/img/faces/5-image.jpg |
| 6 | Tracey | Ramos | tracey.ramos@reqres.in | https://reqres.in/img/faces/6-image.jpg |
Create a Hugo ShortCode
layout/shortcodes/usersJSON.html
Put this as the content of the file
| |
Now to call the shortcode in the markdown file
users-test-data.md
| |
Just note that the above is commented to avoid been processed as shortcode.
Sample JSON data from the above URL Scheme(/api/users)
| |