Enviar búsqueda
Cargar
Getting Rest With Webmachine
•
19 recomendaciones
•
5,725 vistas
K
kevsmith
Seguir
Learn how to use webmachine to build a RESTful web application in Erlang.
Leer menos
Leer más
Tecnología
Noticias y política
Denunciar
Compartir
Denunciar
Compartir
1 de 51
Recomendados
groovy & grails - lecture 3
groovy & grails - lecture 3
Alexandre Masselot
Php variables (english)
Php variables (english)
Mahmoud Masih Tehrani
Introduction to PHP
Introduction to PHP
prabhatjon
Unfiltered Unveiled
Unfiltered Unveiled
Wilfred Springer
PHP for Grown-ups
PHP for Grown-ups
Manuel Lemos
Beginning web programming with PHP [PHP 101-02]
Beginning web programming with PHP [PHP 101-02]
Mozammel Haque
Data Types In PHP
Data Types In PHP
Mark Niebergall
2014 database - course 2 - php
2014 database - course 2 - php
Hung-yu Lin
Recomendados
groovy & grails - lecture 3
groovy & grails - lecture 3
Alexandre Masselot
Php variables (english)
Php variables (english)
Mahmoud Masih Tehrani
Introduction to PHP
Introduction to PHP
prabhatjon
Unfiltered Unveiled
Unfiltered Unveiled
Wilfred Springer
PHP for Grown-ups
PHP for Grown-ups
Manuel Lemos
Beginning web programming with PHP [PHP 101-02]
Beginning web programming with PHP [PHP 101-02]
Mozammel Haque
Data Types In PHP
Data Types In PHP
Mark Niebergall
2014 database - course 2 - php
2014 database - course 2 - php
Hung-yu Lin
Php Lecture Notes
Php Lecture Notes
Santhiya Grace
PHP variables
PHP variables
Siddique Ibrahim
PHP POWERPOINT SLIDES
PHP POWERPOINT SLIDES
Ismail Mukiibi
Php mysql
Php mysql
Alebachew Zewdu
Class 2 - Introduction to PHP
Class 2 - Introduction to PHP
Ahmed Swilam
My cool new Slideshow!
My cool new Slideshow!
omprakash_bagrao_prdxn
slidesharenew1
slidesharenew1
truptitasol
Opa hackathon
Opa hackathon
Henri Binsztok
Intermediate PHP
Intermediate PHP
Bradley Holt
Web 9 | OOP in PHP
Web 9 | OOP in PHP
Mohammad Imam Hossain
RCEC Email 4.7.03 (b)
RCEC Email 4.7.03 (b)
Obama White House
Introduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHP
wahidullah mudaser
Intro to php
Intro to php
Sp Singh
OpenGurukul : Language : PHP
OpenGurukul : Language : PHP
Open Gurukul
TravisCIでErlang/OTP (最小構成版)
TravisCIでErlang/OTP (最小構成版)
Masatoshi Itoh
中高生向けUnity講座
中高生向けUnity講座
Makoto Ito
Unityで使うRabbitMQ
Unityで使うRabbitMQ
Masatoshi Itoh
非同期データ更新のためにメッセージキューを導入した(い)話
非同期データ更新のためにメッセージキューを導入した(い)話
Takaaki Hirano
Elixirについて私が知ってる二、三の事柄
Elixirについて私が知ってる二、三の事柄
Tsunenori Oohara
Shibuya.ex #1 Elixirを本番環境で使ってみたという事例紹介
Shibuya.ex #1 Elixirを本番環境で使ってみたという事例紹介
Tsunenori Oohara
パーフェクト"Elixir情報収集"
パーフェクト"Elixir情報収集"
Keisuke Takahashi
地獄のElixir(目黒スタートアップ勉強会)
地獄のElixir(目黒スタートアップ勉強会)
Tsunenori Oohara
Más contenido relacionado
La actualidad más candente
Php Lecture Notes
Php Lecture Notes
Santhiya Grace
PHP variables
PHP variables
Siddique Ibrahim
PHP POWERPOINT SLIDES
PHP POWERPOINT SLIDES
Ismail Mukiibi
Php mysql
Php mysql
Alebachew Zewdu
Class 2 - Introduction to PHP
Class 2 - Introduction to PHP
Ahmed Swilam
My cool new Slideshow!
My cool new Slideshow!
omprakash_bagrao_prdxn
slidesharenew1
slidesharenew1
truptitasol
Opa hackathon
Opa hackathon
Henri Binsztok
Intermediate PHP
Intermediate PHP
Bradley Holt
Web 9 | OOP in PHP
Web 9 | OOP in PHP
Mohammad Imam Hossain
RCEC Email 4.7.03 (b)
RCEC Email 4.7.03 (b)
Obama White House
Introduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHP
wahidullah mudaser
Intro to php
Intro to php
Sp Singh
OpenGurukul : Language : PHP
OpenGurukul : Language : PHP
Open Gurukul
La actualidad más candente
(14)
Php Lecture Notes
Php Lecture Notes
PHP variables
PHP variables
PHP POWERPOINT SLIDES
PHP POWERPOINT SLIDES
Php mysql
Php mysql
Class 2 - Introduction to PHP
Class 2 - Introduction to PHP
My cool new Slideshow!
My cool new Slideshow!
slidesharenew1
slidesharenew1
Opa hackathon
Opa hackathon
Intermediate PHP
Intermediate PHP
Web 9 | OOP in PHP
Web 9 | OOP in PHP
RCEC Email 4.7.03 (b)
RCEC Email 4.7.03 (b)
Introduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHP
Intro to php
Intro to php
OpenGurukul : Language : PHP
OpenGurukul : Language : PHP
Destacado
TravisCIでErlang/OTP (最小構成版)
TravisCIでErlang/OTP (最小構成版)
Masatoshi Itoh
中高生向けUnity講座
中高生向けUnity講座
Makoto Ito
Unityで使うRabbitMQ
Unityで使うRabbitMQ
Masatoshi Itoh
非同期データ更新のためにメッセージキューを導入した(い)話
非同期データ更新のためにメッセージキューを導入した(い)話
Takaaki Hirano
Elixirについて私が知ってる二、三の事柄
Elixirについて私が知ってる二、三の事柄
Tsunenori Oohara
Shibuya.ex #1 Elixirを本番環境で使ってみたという事例紹介
Shibuya.ex #1 Elixirを本番環境で使ってみたという事例紹介
Tsunenori Oohara
パーフェクト"Elixir情報収集"
パーフェクト"Elixir情報収集"
Keisuke Takahashi
地獄のElixir(目黒スタートアップ勉強会)
地獄のElixir(目黒スタートアップ勉強会)
Tsunenori Oohara
Erlangご紹介 websocket編
Erlangご紹介 websocket編
Masatoshi Itoh
Destacado
(9)
TravisCIでErlang/OTP (最小構成版)
TravisCIでErlang/OTP (最小構成版)
中高生向けUnity講座
中高生向けUnity講座
Unityで使うRabbitMQ
Unityで使うRabbitMQ
非同期データ更新のためにメッセージキューを導入した(い)話
非同期データ更新のためにメッセージキューを導入した(い)話
Elixirについて私が知ってる二、三の事柄
Elixirについて私が知ってる二、三の事柄
Shibuya.ex #1 Elixirを本番環境で使ってみたという事例紹介
Shibuya.ex #1 Elixirを本番環境で使ってみたという事例紹介
パーフェクト"Elixir情報収集"
パーフェクト"Elixir情報収集"
地獄のElixir(目黒スタートアップ勉強会)
地獄のElixir(目黒スタートアップ勉強会)
Erlangご紹介 websocket編
Erlangご紹介 websocket編
Similar a Getting Rest With Webmachine
swift-nio のアーキテクチャーと RxHttpClient
swift-nio のアーキテクチャーと RxHttpClient
Shinya Mochida
Living With Legacy Code
Living With Legacy Code
Rowan Merewood
Anatomy of a PHP Request ( UTOSC 2010 )
Anatomy of a PHP Request ( UTOSC 2010 )
Joseph Scott
Presto anatomy
Presto anatomy
Dongmin Yu
iOS 개발자의 Flutter 체험기
iOS 개발자의 Flutter 체험기
Wanbok Choi
Testing TYPO3 Applications
Testing TYPO3 Applications
André Wuttig
Asynchronous I/O in PHP
Asynchronous I/O in PHP
Thomas Weinert
Javascript Continues Integration in Jenkins with AngularJS
Javascript Continues Integration in Jenkins with AngularJS
Ladislav Prskavec
How to Write Node.js Module
How to Write Node.js Module
Fred Chien
Lecture: Vaadin Overview
Lecture: Vaadin Overview
Joonas Lehtinen
Taipei.py 2018 - Control device via ioctl from Python
Taipei.py 2018 - Control device via ioctl from Python
Hua Chu
Beginner workshop to angularjs presentation at Google
Beginner workshop to angularjs presentation at Google
Ari Lerner
Plack at YAPC::NA 2010
Plack at YAPC::NA 2010
Tatsuhiko Miyagawa
[245] presto 내부구조 파헤치기
[245] presto 내부구조 파헤치기
NAVER D2
Performance measurement and tuning
Performance measurement and tuning
AOE
Mojolicious. Веб в коробке!
Mojolicious. Веб в коробке!
Anatoly Sharifulin
Lecture2_IntroductionToPHP_Spring2023.pdf
Lecture2_IntroductionToPHP_Spring2023.pdf
ShaimaaMohamedGalal
Web Scraping with PHP
Web Scraping with PHP
Matthew Turland
Similar a Getting Rest With Webmachine
(18)
swift-nio のアーキテクチャーと RxHttpClient
swift-nio のアーキテクチャーと RxHttpClient
Living With Legacy Code
Living With Legacy Code
Anatomy of a PHP Request ( UTOSC 2010 )
Anatomy of a PHP Request ( UTOSC 2010 )
Presto anatomy
Presto anatomy
iOS 개발자의 Flutter 체험기
iOS 개발자의 Flutter 체험기
Testing TYPO3 Applications
Testing TYPO3 Applications
Asynchronous I/O in PHP
Asynchronous I/O in PHP
Javascript Continues Integration in Jenkins with AngularJS
Javascript Continues Integration in Jenkins with AngularJS
How to Write Node.js Module
How to Write Node.js Module
Lecture: Vaadin Overview
Lecture: Vaadin Overview
Taipei.py 2018 - Control device via ioctl from Python
Taipei.py 2018 - Control device via ioctl from Python
Beginner workshop to angularjs presentation at Google
Beginner workshop to angularjs presentation at Google
Plack at YAPC::NA 2010
Plack at YAPC::NA 2010
[245] presto 내부구조 파헤치기
[245] presto 내부구조 파헤치기
Performance measurement and tuning
Performance measurement and tuning
Mojolicious. Веб в коробке!
Mojolicious. Веб в коробке!
Lecture2_IntroductionToPHP_Spring2023.pdf
Lecture2_IntroductionToPHP_Spring2023.pdf
Web Scraping with PHP
Web Scraping with PHP
Último
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
Raghuram Pandurangan
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
Dubai Multi Commodity Centre
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
Addepto
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
Dilum Bandara
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
Curtis Poe
How to write a Business Continuity Plan
How to write a Business Continuity Plan
Databarracks
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
Mattias Andersson
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
Kalema Edgar
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
MounikaPolabathina
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
LoriGlavin3
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
LoriGlavin3
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
BookNet Canada
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Mark Simos
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
Alex Barbosa Coqueiro
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
BkGupta21
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
Stephanie Beckett
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
Fwdays
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
2toLead Limited
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
Rizwan Syed
Último
(20)
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
How to write a Business Continuity Plan
How to write a Business Continuity Plan
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
Getting Rest With Webmachine
1.
Getting Some
REST with webmachine Kevin A. Smith
2.
What is webmachine?
3.
Framework
4.
Framework
5.
Toolkit
6.
A toolkit for building
RESTful HTTP resources
7.
What is REST?
8.
Style not a
standard
9.
Resources == URLs
10.
http://localhost:8000/hello_world
11.
http://foo.com/hr/emp/123
12.
GET POST DELETE
PUT
13.
REST is the
shape of the web
14.
-module(hello_world_resource). -export([init/1, to_html/2]). -include_lib("webmachine/include/webmachine.hrl"). init([]) ->
{ok, "Hello, world"}. to_html(Req, State) -> Output = io_lib:format(“<html><body>~s</body></html>”, [State]), {Output, Req, State}.
15.
-module(hello_world_resource). -export([init/1, to_html/2]). -include_lib("webmachine/include/webmachine.hrl"). init([]) ->
{ok, "Hello, world"}. to_html(Req, State) -> Output = io_lib:format(“<html><body>~s</body></html>”, [State]), {Output, Req, State}.
16.
-module(hello_world_resource). -export([init/1, to_html/2]). -include_lib("webmachine/include/webmachine.hrl"). init([]) ->
{ok, "Hello, world"}. to_html(Req, State) -> Output = io_lib:format(“<html><body>~s</body></html>”, [State]), {Output, Req, State}.
17.
-module(hello_world_resource). -export([init/1, to_html/2]). -include_lib("webmachine/include/webmachine.hrl"). init([]) ->
{ok, "Hello, world"}. to_html(Req, State) -> Output = io_lib:format(“<html><body>~s</body></html>”, [State]), {Output, Req, State}.
18.
-module(hello_world_resource). -export([init/1, to_html/2]). -include_lib("webmachine/include/webmachine.hrl"). init([]) ->
{ok, "Hello, world"}. to_html(Req, State) -> Output = io_lib:format(“<html><body>~s</body></html>”, [State]), {Output, Req, State}.
19.
A toolkit for
easily building RESTful HTTP resources
20.
GET /test HTTP/1.1 Host:
localhost:8000 User-Agent: Mozilla/5.0 Accept: text/html;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: UTF-8,* Keep-Alive: 300 Connection: keep-alive HTTP/1.x 200 OK Server: MochiWeb/1.1 WebMachine/1.3 Date: Mon, 22 Jun 2009 02:27:46 GMT Content-Type: text/html Content-Length: 78
21.
-module(hello_world_resource). -export([init/1, to_html/2]). -export([generate_etag/2]). -include_lib("webmachine/include/webmachine.hrl"). init([]) ->
{ok, "Hello, world"}. to_html(Req, State) -> Output = io_lib:format(“<html><body>~s</body></html>”, [State]), {Output, Req, State}. generate_etag(Req, State) -> {mochihex:to_hex(crypto:md5(State)), Req, State}.
22.
GET /test HTTP/1.1 Host:
localhost:8000 User-Agent: Mozilla/5.0 Accept: text/html;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: UTF-8,* Keep-Alive: 300 Connection: keep-alive HTTP/1.x 200 OK Server: MochiWeb/1.1 WebMachine/1.3 Etag: bc6e6f16b8a077ef5fbc8d59d0b931b9 Date: Mon, 22 Jun 2009 02:29:46 GMT Content-Type: text/html Content-Length: 78
23.
GET /test HTTP/1.1 Host:
localhost:8000 . . . If-None-Match: bc6e6f16b8a077ef5fbc8d59d0b931b9 HTTP/1.x 304 Not Modified Server: MochiWeb/1.1 WebMachine/1.3 Etag: bc6e6f16b8a077ef5fbc8d59d0b931b9 Date: Mon, 22 Jun 2009 02:30:00 GMT
24.
-module(hello_world_resource). -export([init/1, to_html/2]). -export([generate_etag/2, encodings_provided/2]). -include_lib("webmachine/include/webmachine.hrl"). init([])
-> {ok, "Hello, world"}. to_html(Req, State) -> Output = io_lib:format(“<html><body>~s</body></html>”, [State]), {Out, Req, State}. generate_etag(Req, State) -> {mochihex:to_hex(crypto:md5(State)), Req, State}. encodings_provided(Req, State) -> {[{"gzip", fun(X) -> zlib:gzip(X) end}], Req, State}.
25.
GET /test HTTP/1.1 Host:
localhost:8000 . . . Accept-Encoding: gzip,deflate HTTP/1.x 200 OK Server: MochiWeb/1.1 WebMachine/1.3 Etag: bc6e6f16b8a077ef5fbc8d59d0b931b9 Date: Mon, 22 Jun 2009 02:46:57 GMT Content-Type: text/html Content-Length: 71 Content-Encoding: gzip
26.
HTTP Is Hard
27.
28.
29.
PUT ERROR
CODES vs. PO ST O N I TI AT ENC O ODI NEG N GS T T EN IDEMPOTENCY N N IO C O IR AT X P STREA E MING T OVE T EN ET RLOA O N G DED C A L POS O N Ts I TI ND CO
30.
Request Routing
31.
http://foo.com/items {["items"], grocery_item_resource, []}.
URL path Resource module Init params
32.
http://foo.com/items/chocolate {["items", item], grocery_item_resource,
[]}. URL path URL variable Resource module Init params
33.
GET
34.
-module(hello_world_resource). -export([init/1,to_html/2]). -include_lib("webmachine/include/webmachine.hrl"). init([]) ->
{ok, "Hello, world"}. to_html(Req, State) -> Output = io_lib:format(“<html><body>~s</body></html>”, [State]), {Output, Req, State}.
35.
Must be idempotent
36.
PUT
37.
-module(grocery_list_resource). -export([init/1,allowed_methods/2]). -export([content_types_accepted/2,from_json/2]). -include_lib("webmachine/include/webmachine.hrl"). init([]) ->
{ok, []}. allowed_methods(Req, State) -> {[‘PUT’], Req, State}. content_types_accepted(Req, State) -> {[{“application/json”, from_json}], Req, State}. from_json(Req, State) -> %% Create/update logic here
38.
DELETE
39.
-module(grocery_list_resource). -export([init/1,allowed_methods/2]). -export([delete_resource/2]). -include_lib("webmachine/include/webmachine.hrl"). init([]) ->
{ok, []}. allowed_methods(Req, State) -> {[‘DELETE’], Req, State}. delete_resource(Req, State) -> %% Deletion logic here
40.
POST
41.
Hmmmm
42.
Problems with
POST
43.
Problems with
POST • Overloaded semantics
44.
Problems with
POST • Overloaded semantics • Create or update?
45.
Creation via
POST •allowed_methods/2 •post_is_create/2 •create_path/2 •content_types_accepted/2 • handler function
46.
Update via
POST •allowed_methods/2 •content_types_accepted/2 • handler function
47.
CODE TIME
48.
HTTP Request
Access
49.
HTTP Request • “Wrapped”
mochiweb request • Separate process for each request • Direct access to: request/response headers, response body, etc.
50.
Other Cool
Stuff • Graphical request debugging • Streaming requests and responses • File uploads
51.
webmachine source:
http://bitbucket.org/justin/webmachine Slides and demo code: http://github.com/kevsmith/erlang_factory/tree/master