Java API's Flashcards

1
Q

What is REST?

A

Representational State Transfer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Who is the consumer in a web service?

A

A piece of software

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does URI?

A

Uniform Resource Identifier

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Why is JSON preferable to XML to pass on information?

A

It is easier for the browser to parse JSON

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How is the xml file used when constructing the API?

A

It shows where the files are for the servlet and then the servlet files has annotations to handle the requests.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the steps to connect to an outside api?

A
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 -
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the advantage of the async http request for java?

A

it allows you to perform other tasks while you are waiting for the response from the request.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is an ORM?

A

Object Relational Mapping

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the classes that are needed to connect and process an outside API?

A
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly