Skip to content

Instantly share code, notes, and snippets.

@fazt
Created October 2, 2020 22:52
Show Gist options
  • Select an option

  • Save fazt/3b0b181f5b779a3a3ab8bf28a110a9c3 to your computer and use it in GitHub Desktop.

Select an option

Save fazt/3b0b181f5b779a3a3ab8bf28a110a9c3 to your computer and use it in GitHub Desktop.

Revisions

  1. Fazt created this gist Oct 2, 2020.
    43 changes: 43 additions & 0 deletions tutorial.rest
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,43 @@
    ### GET POSTS
    // get some post from json placeholder
    GET https://jsonplaceholder.typicode.com/posts

    ### DEFAULT GET
    https://jsonplaceholder.typicode.com/posts

    ### POST
    POST https://jsonplaceholder.typicode.com/posts
    Content-Type: application/json

    {
    "title": "my post",
    "body": "my post body"
    }

    ### GET SINGLE POST
    GET https://jsonplaceholder.typicode.com/posts/1

    ### DELETE POST
    DELETE https://jsonplaceholder.typicode.com/posts/1

    ### PUT POST
    PUT https://jsonplaceholder.typicode.com/posts/1
    Content-Type: application/json

    {
    "title": "My Updated Title",
    "body": "My Updated Body"
    }

    ## Query String
    GET https://jsonplaceholder.typicode.com/posts?_limit=10

    ### Multiple Query
    GET https://jsonplaceholder.typicode.com/posts?_limit=10&_page=2

    ### Separated by lines
    GET https://jsonplaceholder.typicode.com/posts
    ?_limit=10
    &_page=2
    &_sort=id
    &_order=desc