Skip to content
This repository has been archived by the owner on Feb 1, 2020. It is now read-only.

Latest commit

 

History

History

elide-spring-boot-sample

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

elide-spring-boot-sample

Play with Postman

Import the postman_collection.json.

Play with JavaScript

  • CREATE / POST

    var data = {
      "data": {
        "type": "user",
        "attributes": {
          "username": "test",
          "password": "test"
        }
      }
    };
    fetch('http://localhost:8080/api/user', {
      method: 'POST',
      headers: {
        'Accept': 'application/vnd.api+json',
        'Content-Type': 'application/vnd.api+json',
      },
      body: JSON.stringify(data),
    })
    .then(response => response.ok && response.json())
    .then(json => console.log(json));
  • QUERY / GET

    fetch('http://localhost:8080/api/user?page[number]=1&page[size]=3&page[totals]', {
      method: 'GET',
      headers: {
        'Accept': 'application/vnd.api+json',
      },
    })
    .then(response => response.ok && response.json())
    .then(json => console.log(json));
  • UPDATE / PATCH

    var data = {
      "data": {
        "id": "1",
        "type": "user",
        "attributes": {
          "username": "test",
          "encodedPassword": "test"
        }
      }
    };
    fetch('http://localhost:8080/api/user/1', {
      method: 'PATCH',
      headers: {
        'Accept': 'application/vnd.api+json',
        'Content-Type': 'application/vnd.api+json',
      },
      body: JSON.stringify(data),
    })
    .then(response => console.log(response.status === 204 ? 'ok' : 'failure'));
  • DELETE / DELETE

    fetch('http://localhost:8080/api/user/1', {
      method: 'DELETE',
      headers: {
        'Accept': 'application/vnd.api+json',
      },
    })
    .then(response => console.log(response.status === 204 ? 'ok' : 'failure'));

Next

More information about Elide can be found at elide github repo and elide.io.