Suche senden
Hochladen
REST with Her (and let Her take care of the REST)
•
2 gefällt mir
•
3,241 views
Simon Courtois
Folgen
My talk about the Her gem for Paris.rb on july 2, 2013.
Weniger lesen
Mehr lesen
Technologie
Melden
Teilen
Melden
Teilen
1 von 34
Empfohlen
Contributing to Impala
Contributing to Impala
Cloudera, Inc.
Riminder API USER GUIDE - TALENT CLOUD SOLUTION
Riminder API USER GUIDE - TALENT CLOUD SOLUTION
Anicet Fangwa Nantcho
Lucene application
Lucene application
jagruti_bhudiya
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
Atlassian
R.I. Pienaar - Puppet Camp 2010
R.I. Pienaar - Puppet Camp 2010
Puppet
My GAE apps.
My GAE apps.
Lim Chee Aun
Designing Your API
Designing Your API
Alex Payne
java.util.concurrent for Distributed Coordination, JEEConf 2019
java.util.concurrent for Distributed Coordination, JEEConf 2019
Ensar Basri Kahveci
Empfohlen
Contributing to Impala
Contributing to Impala
Cloudera, Inc.
Riminder API USER GUIDE - TALENT CLOUD SOLUTION
Riminder API USER GUIDE - TALENT CLOUD SOLUTION
Anicet Fangwa Nantcho
Lucene application
Lucene application
jagruti_bhudiya
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
Atlassian
R.I. Pienaar - Puppet Camp 2010
R.I. Pienaar - Puppet Camp 2010
Puppet
My GAE apps.
My GAE apps.
Lim Chee Aun
Designing Your API
Designing Your API
Alex Payne
java.util.concurrent for Distributed Coordination, JEEConf 2019
java.util.concurrent for Distributed Coordination, JEEConf 2019
Ensar Basri Kahveci
Php
Php
Ajaigururaj R
PhpSpec extension points
PhpSpec extension points
Norbert Orzechowicz
Morpheus configuration engine (slides from Saint Perl-2 conference)
Morpheus configuration engine (slides from Saint Perl-2 conference)
Vyacheslav Matyukhin
Php
Php
TSUBHASHRI
Php
Php
TSUBHASHRI
Php
Php
TSUBHASHRI
Zephir - A Wind of Change for writing PHP extensions
Zephir - A Wind of Change for writing PHP extensions
Mark Baker
Php Ppt
Php Ppt
Hema Prasanth
Php1
Php1
Reka
Php1(2)
Php1(2)
Reka
Remote File Inclusion / Local File Inclusion [Attack and Defense Techniques]
Remote File Inclusion / Local File Inclusion [Attack and Defense Techniques]
Ismail Tasdelen
My self learing -Php
My self learing -Php
laavanyaD2009
My self learn -Php
My self learn -Php
laavanyaD2009
Php
Php
Vineet Vats
Php1
Php1
poornima sugumaran
Php notes
Php notes
Muthuganesh S
Server Side Swift
Server Side Swift
Jens Ravens
Php1
Php1
poornima sugumaran
Php1
Php1
poornima sugumaran
Laravel 5 New Features
Laravel 5 New Features
Joe Ferguson
Conseils pour un lancement Product Hunt réussi
Conseils pour un lancement Product Hunt réussi
Simon Courtois
Organize your assets with Rails
Organize your assets with Rails
Simon Courtois
Weitere ähnliche Inhalte
Ähnlich wie REST with Her (and let Her take care of the REST)
Php
Php
Ajaigururaj R
PhpSpec extension points
PhpSpec extension points
Norbert Orzechowicz
Morpheus configuration engine (slides from Saint Perl-2 conference)
Morpheus configuration engine (slides from Saint Perl-2 conference)
Vyacheslav Matyukhin
Php
Php
TSUBHASHRI
Php
Php
TSUBHASHRI
Php
Php
TSUBHASHRI
Zephir - A Wind of Change for writing PHP extensions
Zephir - A Wind of Change for writing PHP extensions
Mark Baker
Php Ppt
Php Ppt
Hema Prasanth
Php1
Php1
Reka
Php1(2)
Php1(2)
Reka
Remote File Inclusion / Local File Inclusion [Attack and Defense Techniques]
Remote File Inclusion / Local File Inclusion [Attack and Defense Techniques]
Ismail Tasdelen
My self learing -Php
My self learing -Php
laavanyaD2009
My self learn -Php
My self learn -Php
laavanyaD2009
Php
Php
Vineet Vats
Php1
Php1
poornima sugumaran
Php notes
Php notes
Muthuganesh S
Server Side Swift
Server Side Swift
Jens Ravens
Php1
Php1
poornima sugumaran
Php1
Php1
poornima sugumaran
Laravel 5 New Features
Laravel 5 New Features
Joe Ferguson
Ähnlich wie REST with Her (and let Her take care of the REST)
(20)
Php
Php
PhpSpec extension points
PhpSpec extension points
Morpheus configuration engine (slides from Saint Perl-2 conference)
Morpheus configuration engine (slides from Saint Perl-2 conference)
Php
Php
Php
Php
Php
Php
Zephir - A Wind of Change for writing PHP extensions
Zephir - A Wind of Change for writing PHP extensions
Php Ppt
Php Ppt
Php1
Php1
Php1(2)
Php1(2)
Remote File Inclusion / Local File Inclusion [Attack and Defense Techniques]
Remote File Inclusion / Local File Inclusion [Attack and Defense Techniques]
My self learing -Php
My self learing -Php
My self learn -Php
My self learn -Php
Php
Php
Php1
Php1
Php notes
Php notes
Server Side Swift
Server Side Swift
Php1
Php1
Php1
Php1
Laravel 5 New Features
Laravel 5 New Features
Mehr von Simon Courtois
Conseils pour un lancement Product Hunt réussi
Conseils pour un lancement Product Hunt réussi
Simon Courtois
Organize your assets with Rails
Organize your assets with Rails
Simon Courtois
Speed your Rails app creation with templates
Speed your Rails app creation with templates
Simon Courtois
Dependency sorting in Ruby with TSort
Dependency sorting in Ruby with TSort
Simon Courtois
How Unidecoder Transliterates UTF-8 to ASCII
How Unidecoder Transliterates UTF-8 to ASCII
Simon Courtois
Get Slim!
Get Slim!
Simon Courtois
Multi tenant/lang application with Ruby on Rails
Multi tenant/lang application with Ruby on Rails
Simon Courtois
Fake your files - MemFs
Fake your files - MemFs
Simon Courtois
Rails is like Burger King
Rails is like Burger King
Simon Courtois
Ruby and DCI
Ruby and DCI
Simon Courtois
Cells
Cells
Simon Courtois
Mustdown
Mustdown
Simon Courtois
Vos Regexps sont fausses !
Vos Regexps sont fausses !
Simon Courtois
Ariane
Ariane
Simon Courtois
Pourquoi Ruby on Rails ça déchire ?
Pourquoi Ruby on Rails ça déchire ?
Simon Courtois
Commander
Commander
Simon Courtois
Mehr von Simon Courtois
(16)
Conseils pour un lancement Product Hunt réussi
Conseils pour un lancement Product Hunt réussi
Organize your assets with Rails
Organize your assets with Rails
Speed your Rails app creation with templates
Speed your Rails app creation with templates
Dependency sorting in Ruby with TSort
Dependency sorting in Ruby with TSort
How Unidecoder Transliterates UTF-8 to ASCII
How Unidecoder Transliterates UTF-8 to ASCII
Get Slim!
Get Slim!
Multi tenant/lang application with Ruby on Rails
Multi tenant/lang application with Ruby on Rails
Fake your files - MemFs
Fake your files - MemFs
Rails is like Burger King
Rails is like Burger King
Ruby and DCI
Ruby and DCI
Cells
Cells
Mustdown
Mustdown
Vos Regexps sont fausses !
Vos Regexps sont fausses !
Ariane
Ariane
Pourquoi Ruby on Rails ça déchire ?
Pourquoi Ruby on Rails ça déchire ?
Commander
Commander
Kürzlich hochgeladen
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
Pooja Nehwal
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
debabhi2
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
Delhi Call girls
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
apidays
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
wesley chun
Slack Application Development 101 Slides
Slack Application Development 101 Slides
praypatel2
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
Delhi Call girls
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
Michael W. Hawkins
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
Rafal Los
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Neo4j
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
hans926745
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
Maria Levchenko
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
Enterprise Knowledge
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
Martijn de Jong
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
Sinan KOZAK
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
The Digital Insurer
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
Radu Cotescu
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
gurkirankumar98700
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
Enterprise Knowledge
Kürzlich hochgeladen
(20)
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
Slack Application Development 101 Slides
Slack Application Development 101 Slides
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
REST with Her (and let Her take care of the REST)
1.
@happynoff AndletHertakecareoftheREST RESTwithHer bySimonCourtois
2.
@happynoff Rails+RESTAPI
3.
@happynoff ActiveResource?
4.
@happynoff RemovedinRails4
5.
@happynoff ActiveModel+Net::HTTP?
6.
@happynoff Faraday?
7.
@happynoff Her
8.
@happynoff gem‘her’
9.
@happynoff ontopofFaraday Middlewaresforfree!w00t!
10.
@happynoff # config/initializers/her.rb Her::API.setup url:
'http://api.expl.com' do |co| co.use Faraday::Request::UrlEncoded co.use Her::Middleware::DefaultParseJSON co.use Faraday::Adapter::NetHttp end
11.
@happynoff class User include Her::Model end
12.
@happynoff User.all # GET https://api.expl.com/users #
=> [#<User ...>, #<User ...>, ...]
13.
@happynoff User.find(1) # GET https://api.expl.com/users/1 #
=> #<User ...>
14.
@happynoff User.create(login: “parisrb”) # POST
https://api.expl.com/users # => #<User ...>
15.
@happynoff user = User.create(login:
“parisrb”) user.active = true user.save # POST https://api.expl.com/users # => #<User ...>
16.
@happynoff user = User.find(1) user.active
= true user.save # PUT https://api.expl.com/users/1 # => #<User ...>
17.
@happynoff user = User.find(1) user.destroy #
DELETE https://api.expl.com/users/1 # => #<User ...>
18.
@happynoff ✔BasicCRUD
19.
@happynoff User.where(moderator: 1).all # GET
/users?moderator=1 # => [#<User ...>, ...]
20.
@happynoff class User include Her::Model custom_get
:popular end User.popular # GET /users/popular # => [#<User ...>, #<User ...>]
21.
@happynoff class User include Her::Model collection_path
‘/published-users/:id’ end User.find(1) # GET /published-users/1 # => #<User ...>
22.
@happynoff ✔Customfinders
23.
@happynoff canIhazmanycomments?
24.
@happynoff class User include Her::Model has_many
:comments end class Comment include Her::Model end
25.
@happynoff user = User.find(1) #
GET /users/1 # { "id": 1, "login": "parisrb" } user.comments # GET /users/1/comments # => [#<Comment ...>, #<Comment ...>]
26.
@happynoff user = User.find(1) #
GET /users/1 # { # "id": 1, # "login": "parisrb", # “comments”: [ # { "id": 1, "text": "Foo" }, # { "id": 2, "text": "Bar" } # ] # } user.comments # => [#<Comment ...>, #<Comment ...>]
27.
@happynoff ✔associations
28.
@happynoff Middlewares!
29.
@happynoff gem‘faraday_middleware’
30.
@happynoff # config/initializers/her.rb Her::API.setup url:
'http://api.expl.com' do |co| co.use FaradayMiddleware::Caching, Memcached::Rails.new(...) # ... end
31.
@happynoff customMiddlewares
32.
@happynoff ✔awesomeness
33.
@happynoff http://her-rb.org https://github.com/remiprev/her Her Faraday https://github.com/lostisland/faraday https://github.com/lostisland/faraday_middleware
34.
@happynoff Thankyou!