Practical week 1: HTTP

1. Install Postman

2. Let's have some Cookies

In Web browser visit https://cs.ut.ee

Let's see what info is stored in cookies

How are cookies use for tracking?

  1. You pick up a tracking cookie on your favorite blog or shopping site. That cookie contains a unique ID that doesn’t identify you personally, but does identify your web browser.

  2. The owner of the shopping site signs up and pays for an advertising platform like Google.

  3. Google’s ads aren’t static; when you visit other websites that use Google ads to make money, the website sees the cookie and sends it to Google through the ad. Google sees the unique ID stored in the cookie and recognizes that it came from your favorite shopping site.

  4. Google then shows an ad for the shopping site accordingly.

You can read more about tracking here

3. Run these requests with Postman

Method: GET

URL: https://jsonplaceholder.typicode.com/posts

Method: GET

URL: https://jsonplaceholder.typicode.com/posts/{id}

Method: GET

URL: https://jsonplaceholder.typicode.com/comments?postId={id}

Method: POST

URL: https://jsonplaceholder.typicode.com/posts

Body:

{

"title": "foo",

"body": "bar",

"userId": 1

}

Headers:

{

"Content-type": "application/json; charset=UTF-8"

}

Method: PUT

URL: https://jsonplaceholder.typicode.com/posts/{id}

Body:

{

"id": 1,

"title": "foo",

"body": "bar",

"userId": 1

}

Headers:

{

"Content-type": "application/json; charset=UTF-8"

}

Tasks

Method: GET

URL: https://jsonplaceholder.typicode.com/posts/{id}/comments

Method: GET

URL: https://jsonplaceholder.typicode.com/posts?userId={id}

Method: PATCH

URL: https://jsonplaceholder.typicode.com/posts/{id}

Body:

{

"title": "foo"

}

Headers:

{

"Content-type": "application/json; charset=UTF-8"

}

Method: DELETE

URL: https://jsonplaceholder.typicode.com/posts/{id}