Skip to content

Instantly share code, notes, and snippets.

@dpnl87 dpnl87/starwars.http
Last active Jan 31, 2019

Embed
What would you like to do?
This file is an example on how the use the Visual Studio Code REST Client plugin
### Search for the details of Luke Skywalker
# @name search
GET https://swapi.co/api/people/?search=luke HTTP/1.1
content-type: application/json
### Find the homeworld based on returned search details
# @name planet
GET {{search.response.body.$.results[0].homeworld}} HTTP/1.1
Content-Type: application/json
### Get the species information from the search details
# @name species
GET {{search.response.body.$.results[0].species[0]}} HTTP/1.1
Content-Type: application/json
### Get the first vehicle from the search details
# @name vehicle
GET {{search.response.body.$.results[0].vehicles[0]}} HTTP/1.1
Content-Type: application/json
### Get the first starship from the search details
# @name ship
GET {{search.response.body.$.results[0].starships[0]}} HTTP/1.1
Content-Type: application/json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.