Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
course-material
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IT1901
course-material
Commits
cb292b82
Commit
cb292b82
authored
4 years ago
by
George Adrian Stoica
Browse files
Options
Downloads
Patches
Plain Diff
add slides lecture 17
parent
b431f393
No related branches found
No related tags found
No related merge requests found
Pipeline
#88500
passed
4 years ago
Stage: build
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lectures/revealjs/17-rest-api.adoc
+97
-0
97 additions, 0 deletions
lectures/revealjs/17-rest-api.adoc
with
97 additions
and
0 deletions
lectures/revealjs/17-rest-api.adoc
0 → 100644
+
97
−
0
View file @
cb292b82
= REST APIs
:customcss: slides.css
:icons: font
:includedir: revealjs/includes/
:LECTURE_TOPIC: REST APIs
:LECTURE_NO: 17th Lecture
include::{includedir}header.adoc[]
[.smaller-80][.center-paragraph]
IT1901 Fall 2020 - {LECTURE_NO}
[.smaller-80]
== Overview
- REST APIs
** HTTP requests
** Methods
** APIs
** REST Recap
== HTTP requests
- **H**yper**t**ext **T**ransfer **P**rotocol (HTTP)
- clients (e.g. browser) send requests
- servers (web site / service) send responses
== HTTP Request message
- a request line `GET / HTTP/1.1`
- request headers - `User-Agent`, `Accept`, `Content-Type` etc.
- an empty line (containing only a `carriage return` and a `line feed`)
- an optional message body
== HTTP Methods
- HTTP specification defines `methods` to indicate what action is expected from the server
** GET, HEAD, OPTIONS
** POST, PUT, PATCH
** DELETE
== APIs
- **A**pplication **P**rogramming **I**nterface
- "Glue" that makes possible different pieces of software to interoperate
- It is meant to be machine readable / usable
- APIs are everywhere - at different levels - software libraries, operating system, applications, web services etc.
== APIs (2)
- typically a set of calls or requests, expected call format, expected response format, data structures
- separate the implementation from the interface
- allow programs in one language to use functionality written in some other language
- cater to modular software
[background-color = "#124990"]
[color = "#fff6d5"]
== REST
[.smaller-80]
== REST
- **RE**presentational **S**tate **T**ransfer (REST)
- architectural style involving use of Web Services
- set of constraints are applied
** client server
** statelessness (no client context is stored on the server side)
** cacheability (responses state if they can be cached or not)
** uniform interface
** layered system (adding layers like proxy or load balancer)
== REST (cont.)
- Web services that implement REST are called RESTful APIs
- a base URI, example: https://gitlab.stud.idi.ntnu.no/api/v4
- set of exposed web resources
- standard HTTP methods (e.g., GET, POST, PUT, PATCH and DELETE);
- data formats for requests and responses (json, xml, etc)
== !
image::../images/lecture12/rtodo.png[canvas, size=contain]
== Security considerations
- CORS (Cross-Origin Resource Sharing)
** headers `Access-Control-Allow-Origin`
- Authentication (Basic Auth, OAuth etc)
- HTTPS (HTTP over TLS)
[background-color = "#124990"]
[color = "#fff6d5"]
== Summary
include::{includedir}footer.adoc[]
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment