Materi 1 HTTP
Transcript of Materi 1 HTTP
8/11/2019 Materi 1 HTTP
http://slidepdf.com/reader/full/materi-1-http 1/34
HTTPPemrograman Web
Antonius PG Manginsela
8/11/2019 Materi 1 HTTP
http://slidepdf.com/reader/full/materi-1-http 2/34
Company Logo
Topik Bahasan
5. Versi HTTP
4. Connections
3. HTTP Messages
2. Overview HTTP
1. Terminologi & Definisi
6. Komponen Arsitektur Web
8/11/2019 Materi 1 HTTP
http://slidepdf.com/reader/full/materi-1-http 3/34
user ISP
internet
Web server
http://www.facebook.com.
DNS
Internet & Akses Web
8/11/2019 Materi 1 HTTP
http://slidepdf.com/reader/full/materi-1-http 4/34
1. Terminologi
Internet :
Interconected Network (jaringan komputer yang saling interkoneksi.
WWW :
World Wide Web
Web Page | Laman Web
Halaman world wide web
Web Site | Situs Web :
Situs World Wide WebHome page | Beranda :
Halaman Utama / Indeks
HTTP :
Hyper Text Transfer ProtocolHTML :
Hyper Text Mark Up Language
Browser :
Chrome, Internet Expolorer, Mozilla/Firefox, etc
8/11/2019 Materi 1 HTTP
http://slidepdf.com/reader/full/materi-1-http 5/34
2. Overview HTTP
HTTP: The Internet's Multimedia Courier
Jutaaan data gambar .JPEG,laman HTML, File
Teks, Video/ Film MPEG, WAV audio files, Javaapplets, dan bentuk-bentuk lainnya berjalan dan
berpindah melalui Internet setiap hari 7/24.
HTTP memindahkan paket besar informasidengan cepat, tepat dan reliable dari web server
ke komputer atau telepon pintar setiap individu.
8/11/2019 Materi 1 HTTP
http://slidepdf.com/reader/full/materi-1-http 6/34
Web Client & Server
1. Membuka sebuah laman : "http://www.oreilly.com/index.html,"
2. Browser akan mengirimkan permintaan HTTP ke serverwww.oreilly.com
3. Server akan meresponse dengan mencari objek yang diminta,
halaman awal adalah "/index.html“, jika ada maka objek akan
dikirimkan ke klien dalam bentuk HTTP, bersama dengan
informasi data panjang object dan informasi lainnya.
8/11/2019 Materi 1 HTTP
http://slidepdf.com/reader/full/materi-1-http 7/34
Web Client & Server
Komponen-komponen komunikasi Web Client & Web Server
1. Resources – Jenis, isi dan lokasi dari data / media pada laman web
2. Transactions – Jenis Transaksi antara Client & Server
3. Messages – Pesan yang di kirim dan diterima4. Connections – Koneksi
5. Protocol - Aturan / tata cara
Arsitektur Komponen Web
1. Proxies
HTTP intermediaries that sit between clients and servers
2. Caches
HTTP storehouses that keep copies of popular web pages close to clients
3. Gateways
Special web servers that connect to other applications
4. Tunnels
Special proxies that blindly forward HTTP communications
5. Agents
Semi-intelligent web clients that make automated HTTP requests
8/11/2019 Materi 1 HTTP
http://slidepdf.com/reader/full/materi-1-http 8/34
2.1 Web Resources
Jenis Web Sources :1. Media Types
2. URIs
3. URLs
4. URNs
A web resource is the source of web content
8/11/2019 Materi 1 HTTP
http://slidepdf.com/reader/full/materi-1-http 9/34
2.1.1 Jenis Data/Media
MIME type. : MIME (Multipurpose Internet Mail Extensions)
Digunakan pada protocol HTTP untuk memberikan keterangan
dan label mengenai isi multimdia dalam halaman web
• HTML-formatted text document : ”text/html”
• ASCII text document : ”text/plain”
• JPEG : ”image/jpeg”• GIF-format : ”image/gif”
• Apple QuickTime : ”video/quicktime”
• Microsoft PowerPoint : ”application/vnd.ms-powerpoint”
8/11/2019 Materi 1 HTTP
http://slidepdf.com/reader/full/materi-1-http 10/34
2.1.2 URIs
URI :Universal Resources Identifier
8/11/2019 Materi 1 HTTP
http://slidepdf.com/reader/full/materi-1-http 11/34
2.1.3 URLs
URLs: Uniform Resource Locator
1. URL scheme, memberitahukan protocol http yang digunakan : http, ftp,
mail etc
2. Nama Domain (www.polimdo.ac.id) adalah lokasi server/hosting3. Lokasi Resources (//index.html)
scheme server location resource path:// /
8/11/2019 Materi 1 HTTP
http://slidepdf.com/reader/full/materi-1-http 12/34
2.1.3 URLs
Component Description Default value
scheme Which protocol to use when accessing a server to get a resource. None
user The username some schemes require to access a resource. anonymous
password The password that may be included after the username, separated by a colon (:).<Email
address>
host The hostname or dotted IP address of the server hosting the resource. None
portThe port number on which the server hosting the resource is listening. Many schemes have default
port numbers (the default port number for HTTP is 80).
Scheme-
specific
pathThe local name for the resource on the server, separated from the previous URL components by a
slash (/). The syntax of the path component is server- and scheme-specific.None
params
Used by some schemes to specify input parameters. Params are name/value pairs. A URL can
contain multiple params fields, separated from themselves and the rest of the path by semicolons
(;).
None
query
Used by some schemes to pass parameters to active applications (such as databases, bulletin
boards, search engines, and other Internet gateways). There is no common format for the
contents of the query component. It is separated from the rest of the URL by the "?" character.
None
frag
A name for a piece or part of the resource. The frag field is not passed to the server when
referencing the object; it is used internally by the client. It is separated from the rest of the URL by
the "#" character.
None
Syntax :
<scheme>://<user>:<password>@<host>:<port>/<path>;<params>?<query>#<frag>
Tabel Komponen-komponen URL
8/11/2019 Materi 1 HTTP
http://slidepdf.com/reader/full/materi-1-http 13/34
2.1.3 URNs
• A URN serves as a unique name for a particular piece of content,
independent of where the resource currently resides.
• These location-independent URNs allow resources to move from place to
place. URNs also allow resources to be accessed by multiple network
access protocols while maintaining the same name.
• For example, the following URN might be used to name the Internet
standards document "RFC 2141" regardless of where it resides (it may even
be copied in several places):
urn:ietf:rfc:2141
• URNs are still experimental and not yet widely adopted. To work effectively,URNs need a supporting infrastructure to resolve resource locations; the
lack of such an infrastructure has also slowed their adoption
Uniform Resource Name
8/11/2019 Materi 1 HTTP
http://slidepdf.com/reader/full/materi-1-http 14/34
2.2 Transactions
• Methods
• Status Codes
• Multiple Objects
Transaksi HTTP :
“request” (client to server),
“response” (server to client)
Disebut “HTTP messages”
8/11/2019 Materi 1 HTTP
http://slidepdf.com/reader/full/materi-1-http 15/34
2.2.1 Methods
GET PUT
HEAD
POST
8/11/2019 Materi 1 HTTP
http://slidepdf.com/reader/full/materi-1-http 16/34
2.2.1 Methods
DELETE OPTION
TRACE
Extension Methods
Method Description
LOCK
Allows a user to "lock" a resource—for example,
you could lock a resource while you are editing it to
prevent others from editing it at the same time
MKCOL Allows a user to create a resource
COPY Facilitates copying resources on a server
MOVE Moves a resource on a server
8/11/2019 Materi 1 HTTP
http://slidepdf.com/reader/full/materi-1-http 17/34
2.2.2 Status Codes
Kelompok Status Codes :
1. 100-199: Informational Status Codes
2. 200-299: Success Status Codes
3. 300-399: Redirection Status Codes
4. 400-499: Client Error Status Codes
5. 500-599: Server Error Status Codes
Setiap pesan balasan dari Server ke Klien berisi “Status Code”.
Status Code adalah tiga digit kode numeric yang memberitahukan klien jika
permintaan berhasil atau kondisi/aksi yang diperlukan.
8/11/2019 Materi 1 HTTP
http://slidepdf.com/reader/full/materi-1-http 18/34
2.2.3 Multi Objek
Jadi, "web page" sering merupakan
kumpulan dari berbagai resources bukan
hanya sebuah resource.
8/11/2019 Materi 1 HTTP
http://slidepdf.com/reader/full/materi-1-http 19/34
3. HTTP Messages
Request Messages Response Messages
HTTP messages adalah paket-paket data yang digunakan untuk memindahkandata/informasi keberbagai tujuan.
Terdiri atas :
1. Start line
Untuk memberikan informasi awal atas permintaan/ request atau apa yang terjadi
atas permintaan / response.
2. Header fieldsSetiap header fields terdiri atas nama dan nilai yang dipisahkan oleh titik dua (:)
diakhiri dengan 1 baris kosong.
3. Body
Berisi berbagai jenis data (teks, gambar, video, audio etc)
Requet body membawa permintaan data ke Server
Response body membawa data ke client
8/11/2019 Materi 1 HTTP
http://slidepdf.com/reader/full/materi-1-http 20/34
3. HTTP Messages
8/11/2019 Materi 1 HTTP
http://slidepdf.com/reader/full/materi-1-http 21/34
4. Connections
1. TCP/IP
2. Connections, IP Addresses, and Port Numbers
HTTP NETWORK PROTOCOL STACK
TCP/IP LAYER
HTTP : application layer protocol.
TCP :
Error-free data transportation
In-order delivery
Unsegmented data stream
Sekali koneksi TCP telah terbentuk,
pertukaran messages antar klien &
server tidak hilang, tertukar maupun
rusak.
8/11/2019 Materi 1 HTTP
http://slidepdf.com/reader/full/materi-1-http 22/34
4.1 IP Addresses & Numbers
Before an HTTP client can send a message to a server, it needs to establish a
TCP/IP connection between the client and server using Internet protocol (IP)
addresses and port numbers.
In TCP, you need the IP address of the server computer and the TCP portnumber associated with the specific software program running on the server.
8/11/2019 Materi 1 HTTP
http://slidepdf.com/reader/full/materi-1-http 23/34
Koneksi Browser
a. The browser extracts the server's
hostname from the URL.
b. The browser converts the server's
hostname into the server's IP address.
c. The browser extracts the port number (ifany) from the URL.
d. The browser establishes a TCP
connection with the web server.
e. The browser sends an HTTP request
message to the server.f. The server sends an HTTP response
back to the browser.
g. The connection is closed, and the
browser displays the document.
a
b
cd
e
f
g
8/11/2019 Materi 1 HTTP
http://slidepdf.com/reader/full/materi-1-http 24/34
5. Versi HTTP
HTTP/0.9
Support GET method, tidak support MIME, HTTP headers, atau version
numbers.
HTTP/1.0 1.0 was the first version of Support tampilan grafik dan form-interaktif pada halaman web
HTTP/1.0+
Dikembangkan mid-1990s kebutuhan penggunaan web komersil, Fitur
ditambahkan "keep-alive" connections, virtual hosting support, and
proxy connection support, dan menjadi standar de-facto.
HTTP/1.1 ,
Fokus pada perbaikan architectural flaws dalam disain HTTP,. HTTP/1.1 is the
current version of HTTP.
HTTP-NG (a.k.a. HTTP/2.0)tambahkan disini
8/11/2019 Materi 1 HTTP
http://slidepdf.com/reader/full/materi-1-http 25/34
6. Komponen Arsitektur Web
Proxies [Server]
Alat yang terletak diantara clients dan servers
Caches
Tempat penyimpanan duplikat dari laman, dokumen/ file di
dekat klien (Proxy Server)
Gateways / Portal
Web Server khusus yang terhubung dengan aplikasi /serer lainnya.
Tunnels
Meneruskan komunikasi lain melalui saluran HTTP atau
Non-HTTP.
Agents
Web Client yang secara otomatis mengirimkan permintaan
HTTP secara terprogram, ex. Search engine
8/11/2019 Materi 1 HTTP
http://slidepdf.com/reader/full/materi-1-http 26/34
8/11/2019 Materi 1 HTTP
http://slidepdf.com/reader/full/materi-1-http 27/34
6.2 Caches
HTTP proxy server yang menyimpan
laman/dokumen/file yang sering diakses (Web Cache)
yang melewati sebuah proxy server. Cara penyimpanan ini memperbaiki kinerja jaringan.
Client lebih cepat mengunduh file/laman/dokumen
Topologi Cache Private & Public Cache
8/11/2019 Materi 1 HTTP
http://slidepdf.com/reader/full/materi-1-http 28/34
6.3 Gateways
HTTP/FTP GatewayDapat berfungsi seperti penterjemah atau penunjuk jalan
untuk menuju/mendapatkan resources
Sebuah Gateway HTTP/FTP menerima permintaan data ke URL FTPmelalui HTTP Request, tetapi mengambilnya dengan menggunakan
protocol FTP dari FTP Server.
8/11/2019 Materi 1 HTTP
http://slidepdf.com/reader/full/materi-1-http 29/34
6.4 Tunnels
Tunnels meneruskan data/laman http melalui
jaringan non-HTTP
Salah satu penggunaan HTTP Tunnel adalah membawa lalulintas data ter-
enkripsi atau encrypted Secure Sockets Layer (SSL) melalui sebuah koneksi
HTTP dan mengijinkan lalu lintas data SSL melewati sebuah Firewall Jaringan
LAN sebuah organisasi.
8/11/2019 Materi 1 HTTP
http://slidepdf.com/reader/full/materi-1-http 30/34
6.5 Agents
Automated search engine "spiders" are
agents, fetching web pages around the
world
Komputer yang secara otomatis
mengakses laman web tanpa diawasi
oleh manusia disebut “ spider” atau
“ Web Robots”
8/11/2019 Materi 1 HTTP
http://slidepdf.com/reader/full/materi-1-http 31/34
Kesimpulan
Peran HTTP's sebagai tata cara
mengirim dan menerima file multimedia
Mempelajarai penggunaan HTTP,komponen dan struktur.
Hypertext Transfer Protocol (HTTP) dimanfaatkan banyak
tugas selain untuk hypertext.
HTTP adalah bahasa komunikasi antara web browser dan
web server, dimana kebanyakan komunikasi ini di luar
perhatian pemakai web browser .
8/11/2019 Materi 1 HTTP
http://slidepdf.com/reader/full/materi-1-http 32/34
Tugas Individu
Buka 5 (Lima) Situs Indonesia (.id) :
CO.ID
AC.ID
GO.ID
Buka 5 (Lima) Situs Luar Negeri
.COM
.GOV
.EDU
Capture Tampilan Halaman Utama masing-masing
web
Buat kesimpulan anda sendiri mengenai : Layout / Tata Letak
Navigasi / Petunjuk Laman
Fasilitas / Fitur
8/11/2019 Materi 1 HTTP
http://slidepdf.com/reader/full/materi-1-http 33/34
Referensi & Sumber Internet
1. Anon, “ The HTTP Definitive Guide” ,
O'Reilly & Associates, USA, 2002
2. http://www.w3.org/Protocols/This W3C web page contains many great
links about the HTTP protocol.