Skip to content

Instantly share code, notes, and snippets.

@TechWatching
Created March 4, 2019 06:10
Show Gist options
  • Save TechWatching/68028e467156017b4c74dbd32791a4b2 to your computer and use it in GitHub Desktop.
Save TechWatching/68028e467156017b4c74dbd32791a4b2 to your computer and use it in GitHub Desktop.
HTTP requests for the Star Wars API
#### List of start wars planets
GET https://swapi.co/api/planets/ HTTP/1.1
### Get Luke Skywalker
# @name lukeRequest
GET https://swapi.co/api/people/?search=Luke HTTP/1.1
### Get Luke Skywalker home planet
GET {{lukeRequest.response.body.results[0].homeworld}} HTTP/1.1
### List available resources
GET https://swapi.co/api/ HTTP/1.1
### Search planet with a specific name
@planetName = Naboo
GET https://swapi.co/api/planets/?search={{planetName}} HTTP/1.1
### Search planet with a specific name in wookie encoding
GET https://swapi.co/api/planets/?search={{planetName}}&format=wookiee HTTP/1.1
### List starships
GET https://swapi.co/api/starships HTTP/1.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment