Materi 1 Kuliah Pemrograman Web

Post on 06-Jul-2015

378 views 2 download

description

Topik HTTP dalam Kuliah Pemrograman Web

Transcript of Materi 1 Kuliah Pemrograman Web

HTTPPemrograman WebAntonius PG Manginselaanton@polimdo.ac.id, anton.polimdo@gmail.com

Company Logo

Topik Bahasan

5. Versi HTTP

4. Connections

3. HTTP Messages

2. Overview HTTP

1. Terminologi & Definisi

6. Komponen Arsitektur Web

user ISP

internet

Web server

http://www.facebook.com.

DNS

Internet & Akses Web

www.polimdo.ac.idanton@polimdo.ac.id

1. TerminologiInternet :

Interconected Network (jaringan komputer yang saling interkoneksi.

WWW :World Wide Web

Web Page | Laman WebHalaman world wide web

Web Site | Situs Web :Situs World Wide Web

Home page | Beranda :Halaman Utama / Indeks

HTTP :Hyper Text Transfer Protocol

HTML :Hyper Text Mark Up Language

Browser :Chrome, Internet Expolorer, Mozilla/Firefox, etc

2. Overview HTTPHTTP: The Internet's Multimedia Courier

Jutaaan data gambar .JPEG,laman HTML, File Teks, Video/ Film MPEG, WAV audio files, Java applets, dan bentuk-bentuk lainnya berjalan dan berpindah melalui Internet setiap hari 7/24. HTTP memindahkan paket besar informasi dengan cepat, tepat dan reliable dari web server ke komputer atau telepon pintar setiap individu.

anton@polimdo.ac.id

Web Client & Server

anton@polimdo.ac.id

1. Membuka sebuah laman : "http://www.oreilly.com/index.html," 2. Browser akan mengirimkan permintaan HTTP ke server

www.oreilly.com3. Server akan meresponse dengan mencari objek yang diminta,

halaman awal adalah "/index.html“, jika ada maka objek akandikirimkan ke klien dalam bentuk HTTP, bersama denganinformasi data panjang object dan informasi lainnya.

Web Client & Server

anton@polimdo.ac.id

Komponen-komponen komunikasi Web Client & Web Server 1. Resources – Jenis, isi dan lokasi dari data / media pada laman web2. Transactions – Jenis Transaksi antara Client & Server3. 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 servers2. Caches

HTTP storehouses that keep copies of popular web pages close to clients 3. Gateways

Special web servers that connect to other applications4. Tunnels

Special proxies that blindly forward HTTP communications5. Agents

Semi-intelligent web clients that make automated HTTP requests

2.1 Web Resources

anton@polimdo.ac.id

Jenis Web Sources :1. Media Types2. URIs3. URLs4. URNs

A web resource is the source of web content

2.1.1 Jenis Data/Media

anton@polimdo.ac.id

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”

2.1.2 URIs

anton@polimdo.ac.id

URI :Universal Resources Identifier

2.1.3 URLs

anton@polimdo.ac.id

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:// /

2.1.3 URLs

anton@polimdo.ac.id

Component Description Default value

scheme Which protocol to use when accessing a server to get a resource. Noneuser 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

port The 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

path The 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

paramsUsed 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

queryUsed 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

fragA 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

2.1.3 URNs

anton@polimdo.ac.id

• 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

2.2 Transactions

anton@polimdo.ac.id

• Methods• Status Codes• Multiple Objects

Transaksi HTTP : “request” (client to server), “response” (server to client)Disebut “HTTP messages”

2.2.1 Methods

anton@polimdo.ac.id

GET PUT

HEAD

POST

2.2.1 Methods

anton@polimdo.ac.id

DELETE OPTION

TRACE

Extension Methods

Method Description

LOCKAllows 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

2.2.2 Status Codes

anton@polimdo.ac.id

Kelompok Status Codes :1. 100-199: Informational Status Codes2. 200-299: Success Status Codes3. 300-399: Redirection Status Codes4. 400-499: Client Error Status Codes5. 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.

2.2.3 Multi Objek

anton@polimdo.ac.id

Jadi, "web page" sering merupakankumpulan dari berbagai resources bukanhanya sebuah resource.

3. HTTP Messages

anton@polimdo.ac.id

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 terjadiatas permintaan / response.

2. Header fields Setiap 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 ServerResponse body membawa data ke client

3. HTTP Messages

anton@polimdo.ac.id

4. Connections

anton@polimdo.ac.id

1. TCP/IP2. 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 maupunrusak.

4.1 IP Addresses & Numbers

anton@polimdo.ac.id

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 port number associated with the specific software program running on the server.

Contoh : http://www.polimdo.ac.id/index.html http://119.81.88.232:80/index.html

Koneksi Browser

anton@polimdo.ac.id

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 (if any) 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

c d

e

f

g

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

anton@polimdo.ac.id

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 engineanton@polimdo.ac.id

6.1 Proxies Sebuah proxy alat / aplikasi yang berada diantara client

dan sebuah server, Proxy menerima semua permintaan HTTP dari para client

dan meneruskan ke server tujuan. Proxy digunakan untuk maksud keamanan, memfilter isi

maupun data yang masuk maupun keluar pada client. Contoh :

Mendeteksi virus pada suatu web Filter isi web seperti Pornografi, Kekerasan dlsb.

anton@polimdo.ac.id

Topologi Proxy

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

anton@polimdo.ac.id

Topologi Cache Private & Public Cache

6.3 GatewaysHTTP/FTP GatewayDapat berfungsi seperti penterjemah atau penunjuk jalan untuk menuju/mendapatkan resources

anton@polimdo.ac.id

Sebuah Gateway HTTP/FTP menerima permintaan data ke URL FTP melalui HTTP Request, tetapi mengambilnya dengan menggunakan protocol FTP dari FTP Server.

6.4 TunnelsTunnels meneruskan data/laman http melalui jaringan non-HTTP

anton@polimdo.ac.id

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.

6.5 AgentsAutomated 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”

anton@polimdo.ac.id

KesimpulanPeran HTTP's sebagai tata cara

mengirim dan menerima file multimediaMempelajarai penggunaan HTTP,

komponen dan struktur.

anton@polimdo.ac.id

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.

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

anton@polimdo.ac.id

Referensi & Sumber Internet1. 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.

anton@polimdo.ac.id

anton@polimdo.ac.id