Java API's Flashcards
What is REST?
Representational State Transfer
Who is the consumer in a web service?
A piece of software
What does URI?
Uniform Resource Identifier
Why is JSON preferable to XML to pass on information?
It is easier for the browser to parse JSON
How is the xml file used when constructing the API?
It shows where the files are for the servlet and then the servlet files has annotations to handle the requests.
What are the steps to connect to an outside api?
1- Import java.net.URL 2- Create variable for url 3- Import java.net.httpURlConnection 4- Create a connection 5- Use request method 6- set connection timeout 7- Get Response code 8 - Need to set up an input stream because the response you get back will be an input stream hence the input stream reader 9 Wrap input stream reader inside a buffered reader 10 -
What is the advantage of the async http request for java?
it allows you to perform other tasks while you are waiting for the response from the request.
What is an ORM?
Object Relational Mapping
What are the classes that are needed to connect and process an outside API?
1- Need a class to map to the data from the API 2- Need a class to connect to the api 3- Need an interface to make the request