UNIT-6 Flashcards
API
Application Programming Interface
Request
Please give me some data
Response
OK, here’s some data for you
Request
CLIENT uses browser GETS from SERVER
HTTP Request Verbs
Request action options
HTTP Verbs
GET
POST
PUT
DELETE
get data sent to you from the server
GET
add data to the server
POST
update data on the server
PUT
delete data from the serve
DELETE
RESPONSE
Server responds to client through BROWSER
JSON
JavaScript Object Notation
JSON STRUCTURE
key and value
{
“name”: “Robert”
“hobby”: “first aiding”
}
Everything is an _____.
OBJECT
METHOD
honk: function() { alert(“BEEEPPPPPP”) }
use dot after the object name to access properties and methods
DOT NOTATION
RESPONSE
CLIENT <—string—-readable stream—- SERVER
need to convert the data to JSON
Parse
parse example
STRING —-JSON.parse(response)> JSON “name”:”robert”
response example
Readable Stream —-response.json()—-> JSON