Submit Search
Upload
REST with Her (and let Her take care of the REST)
•
2 likes
•
3,240 views
Simon Courtois
Follow
My talk about the Her gem for Paris.rb on july 2, 2013.
Read less
Read more
Technology
Report
Share
Report
Share
1 of 34
Recommended
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
More Related Content
Similar to 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(2)
Php1(2)
Reka
Php1
Php1
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
Similar to 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(2)
Php1(2)
Php1
Php1
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
More from 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
More from 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
Recently uploaded
Scenario Library et REX Discover industry- and role- based scenarios
Scenario Library et REX Discover industry- and role- based scenarios
Erol GIRAUDY
SheDev 2024
SheDev 2024
GDSC PJATK
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
Neo4j
Graphene Quantum Dots-Based Composites for Biomedical Applications
Graphene Quantum Dots-Based Composites for Biomedical Applications
nooralam814309
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
Extra-120324-Visite-Entreprise-icare.pdf
Extra-120324-Visite-Entreprise-icare.pdf
Infopole1
March Patch Tuesday
March Patch Tuesday
Ivanti
UiPath Studio Web workshop series - Day 2
UiPath Studio Web workshop series - Day 2
DianaGray10
Trailblazer Community - Flows Workshop (Session 2)
Trailblazer Community - Flows Workshop (Session 2)
Muhammad Tiham Siddiqui
My key hands-on projects in Quantum, and QAI
My key hands-on projects in Quantum, and QAI
Vijayananda Mohire
EMEA What is ThousandEyes? Webinar
EMEA What is ThousandEyes? Webinar
ThousandEyes
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
Safe Software
Stobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
Stobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
Stobox
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Tejal81
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
xtailishbaloch
From the origin to the future of Open Source model and business
From the origin to the future of Open Source model and business
Francesco Corti
Automation Ops Series: Session 2 - Governance for UiPath projects
Automation Ops Series: Session 2 - Governance for UiPath projects
DianaGray10
Top 10 Squarespace Development Companies
Top 10 Squarespace Development Companies
TopCSSGallery
Patch notes explaining DISARM Version 1.4 update
Patch notes explaining DISARM Version 1.4 update
adam112203
How to release an Open Source Dataweave Library
How to release an Open Source Dataweave Library
shyamraj55
Recently uploaded
(20)
Scenario Library et REX Discover industry- and role- based scenarios
Scenario Library et REX Discover industry- and role- based scenarios
SheDev 2024
SheDev 2024
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
Graphene Quantum Dots-Based Composites for Biomedical Applications
Graphene Quantum Dots-Based Composites for Biomedical Applications
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Extra-120324-Visite-Entreprise-icare.pdf
Extra-120324-Visite-Entreprise-icare.pdf
March Patch Tuesday
March Patch Tuesday
UiPath Studio Web workshop series - Day 2
UiPath Studio Web workshop series - Day 2
Trailblazer Community - Flows Workshop (Session 2)
Trailblazer Community - Flows Workshop (Session 2)
My key hands-on projects in Quantum, and QAI
My key hands-on projects in Quantum, and QAI
EMEA What is ThousandEyes? Webinar
EMEA What is ThousandEyes? Webinar
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
Stobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
Stobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
From the origin to the future of Open Source model and business
From the origin to the future of Open Source model and business
Automation Ops Series: Session 2 - Governance for UiPath projects
Automation Ops Series: Session 2 - Governance for UiPath projects
Top 10 Squarespace Development Companies
Top 10 Squarespace Development Companies
Patch notes explaining DISARM Version 1.4 update
Patch notes explaining DISARM Version 1.4 update
How to release an Open Source Dataweave Library
How to release an Open Source Dataweave Library
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!