1. HTTP

1.1. Narzędzia

1.1.1. Web Inspector

1.1.2. curl

1.1.3. wget

1.2. DNS

  • /etc/hosts

  • DNS

1.3. HTTP Protocol

1.3.1. HTTP and HTTPS

1.3.2. HTTP/1.1 vs. HTTP/2.0

1.3.3. URI vs URL

  • SEO friendly URL

1.3.4. text protocol

1.3.5. Status Code

Tab. 1.33. Http Response Codes

Status

Name

Description

200

OK

201

Created

301

Moved Permanently

400

Bad Request

403

Forbidden

404

File not Found

500

Internal Server Error

1.3.7. q=... parameters

Accept-Language: en-US,en;q=0.9,pl;q=0.8

1.3.8. Request

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9,pl;q=0.8
Cache-Control: max-age=0
Connection: keep-alive
Cookie: _ga=GA1.2.1711323714.1523218102; csrftoken=CwTmac4VUT7FcyFAEKkIXWCxQurIZVbU
DNT: 1
Host: python.astrotech.io
If-Modified-Since: Wed, 13 Jun 2018 00:15:11 GMT
If-None-Match: W/"5b20620f-60e2"
Referer: http://python.astrotech.io/django/django-apps.html
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36

1.3.9. Response

Connection: keep-alive
Date: Wed, 13 Jun 2018 07:21:58 GMT
ETag: "5b20620f-60e2"
Last-Modified: Wed, 13 Jun 2018 00:15:11 GMT
Server: nginx/1.10.3 (Ubuntu)
X-Cname-TryFiles: True
X-Deity: web01
X-Served: Nginx

1.3.10. stateless

1.3.11. sessions

  • bazy danych

  • cache

  • pliki

  • memory

1.3.12. Cookies

  • ustawa o cookies

1.4. HTTP Methods

Tab. 1.34. Http Response Codes

GET

POST

PUT

PATCH

DELETE

HEAD

OPTIONS

TRACE

1.4.1. GET vs POST

  • przekazywanie parametrów

  • ?zmienna1=wartosc&zmienna2=wartosc

  • przesylanie plikow

  • przesylanie tablicy zmiennych

  • bezpieczeństwo

1.4.2. POST vs. PUT

1.4.3. POST and CSRF

  • csrf_token

1.4.4. PATCH?!

1.4.5. OPTIONS and CORS

http_method_names = ['get', 'post', 'options']

def options(self, request, *args, **kwargs):
    response = HttpResponse(status=200)
    response['Access-Control-Allow-Origin'] = '*'
    response['Access-Control-Allow-Methods'] = ', '.join(http_method_names).upper()
    response['Access-Control-Allow-Headers'] = 'Content-Type'
    return response

1.5. HTML + JS + CSS