Intro to HTTP
CSCI 344: Advanced Web Technologies
Spring 2025
Weekly Announcements
Outline
Outline
Let’s discuss Tutorial 6
Outline
Understanding how to work with Web Services & APIs is so useful!
What is a Web API?
API → “Application Programming Interface”
A set of rules that you have to follow to interact with a piece of software
Web API
An API that you access via HTTP protocol. Offers a systematic way to:
REST API
A kind of Web API that honors the “REST” endpoint design conventions
8
Many Organizations Publish their Data via Web APIs
Outline
HTTP: Hypertext Transfer Protocol
Web servers communicate through HTTP – a stateless protocol for encoding, decoding, and transmitting messages over the web.
11
HTTP Methods
Methods tell the server what action they should take (verbs):
12
Method | Job | Description |
GET | Read | Retrieves / reads a resource (or container of resources) from an address (endpoint) on a server |
POST | Create | Creates a NEW resource on a server; done by posting data to an address (endpoint) on a server |
PUT | Replace | Replaces a resource on a server |
PATCH | Update | Updates a resource on a server |
DELETE | Deletes | Deletes a resource on a server |
HTTP Status Codes
Status codes provide information re: whether your request was successful. Here is a list of them. Ones you should be familiar with:
Code | Definition |
201 | POST method successfully created a resource |
200 | Valid request made (generic success message) |
400 | Client posted a bad request that the server can’t understand |
403 | Forbidden (you don’t have access to it) |
404 | Resource cannot be found |
500 | Server error (usually because there’s a server bug) |
Outline
Interacting with a Web / REST API: Clients
You can access a REST API via many different clients (including):
Interacting with a Web API: Authentication
16
Photo App API: Practice