Created
January 8, 2019 03:02
-
-
Save joshuaaguilar20/a6c33f95f3fe8aa0c54f2d6ade9499de to your computer and use it in GitHub Desktop.
mondaynotes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JSON = BIG Object | |
LINK- https://repl.it/@joshuaaguilar20/IndeliblePessimisticProfessionals | |
Example API call. | |
Go WebSite and reuqest data. | |
Request URL Get 200 Todos- | |
-get (asking for information) | |
https://jsonplaceholder.typicode.com/todos | |
fetch('https://jsonplaceholder.typicode.com/todos') | |
.then(function(response) { | |
return response.json(); | |
}) | |
.then(function(myJson) { | |
console.log(JSON.stringify(myJson)); | |
}); | |
-post | |
Sending Information | |
{ | |
"data": [{ | |
"type": "articles", | |
"id": "1", | |
"attributes": { | |
"title": "JSON:API paints my bikeshed!", | |
"body": "The shortest article. Ever." | |
}, | |
"relationships": { | |
"author": { | |
"data": {"id": "42", "type": "people"} | |
} | |
} | |
}], | |
"included": [ | |
{ | |
"type": "people", | |
"id": "42", | |
"attributes": { | |
"name": "John" | |
} | |
} | |
] | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment