Networking Flashcards

1
Q

Networking:

What is CORS (cross origin resource sharing)

A

Selectively unblock cross domain data (get data from two websites) different origins

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

Networking:

What is the header for CORS

A

Access-Control-Allow-Origin:domian.com

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

Networking:

Access-Control-Allow-Origin:domian.com

what does the called domain have to be

A

The same domain as the origin

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

Networking:

Access-Control-Allow-Origin:*

What does the star mean?

A

Anyone can us the info from that domain

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

Networking:

Access-Control-Allow-Origin:domian.com

Is the response or request being block if the domains don’t match?

A

response being blocked

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

Networking:

Access-Control-Allow-Origin:domian.com

This doesn’t block for

A

Puts
Posts
Deletes

Only blocking response

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

Networking:

Request a Put from another domain
Pre flight options

A

Access-Control-Request-Method;PUT

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

Networking:

JSONP only works with what type of requests

A

GET

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

Networking:

What two JSONP good for

A

1) Simple Requests

2) Easy to use

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

Networking:

What does JSONP return

A

It returns a json file wrapped in a function.

adamFunction (
   [
    "id":1,
     "first: "adam",
     "last": "Cadieux"
    ]
);
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How does JSONP get around cross origin problem

A

by just calling a script

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

What does CORS stand for?

A

cross origin resource sharing

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

What header is always sent by the browser on a CORS request?

A

Origin

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

What header needs the be present on a CORS response to a GET request for the browser to allow a request to pass through?

A

Access-Control-Allow-Origin

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

If we were making a POST CORS request, what HTTP request does the browser send first?

A

Options

“pre-flight” options request first to check to see if it can send a POST request later on

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

When we make a POST CORS request, the response to the pre-flight request needs to contain a header with a specific value.

Which of the below options would be an acceptable response for the browser to allow the POST request?

A

Access-Control-Request-Method: POST,PUT,GET,DELETE