Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
UW Advanced Rails Week 4
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Ben Woodall
April 23, 2015
Programming
0
71
UW Advanced Rails Week 4
Ben Woodall
April 23, 2015
Tweet
Share
More Decks by Ben Woodall
See All by Ben Woodall
UW Advanced Rails Week 9
benwoodall
0
43
UW Advanced Rails Week 8
benwoodall
0
50
UW Advanced Rails Week 7
benwoodall
0
46
Week 6
benwoodall
0
50
UW Advanced Rails Week 5
benwoodall
0
56
UW Advanced Rails Week 3
benwoodall
0
69
UW Advanced Rails Week 2
benwoodall
0
180
UW Advanced Rails Week 1
benwoodall
0
99
A Bit More Git
benwoodall
1
5.1k
Other Decks in Programming
See All in Programming
Vibe Coding - AI 驅動的軟體開發
mickyp100
0
170
Fragmented Architectures
denyspoltorak
0
140
Unicodeどうしてる? PHPから見たUnicode対応と他言語での対応についてのお伺い
youkidearitai
PRO
1
1.1k
Oxlintはいいぞ
yug1224
5
1.3k
AIエージェントの設計で注意するべきポイント6選
har1101
7
3.4k
CSC307 Lecture 04
javiergs
PRO
0
650
AgentCoreとHuman in the Loop
har1101
5
220
CSC307 Lecture 09
javiergs
PRO
1
830
フルサイクルエンジニアリングをAI Agentで全自動化したい 〜構想と現在地〜
kamina_zzz
0
400
AIフル活用時代だからこそ学んでおきたい働き方の心得
shinoyu
0
130
HTTPプロトコル正しく理解していますか? 〜かわいい猫と共に学ぼう。ฅ^•ω•^ฅ ニャ〜
hekuchan
2
680
Implementation Patterns
denyspoltorak
0
280
Featured
See All Featured
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.7k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
920
The Curious Case for Waylosing
cassininazir
0
230
Claude Code のすすめ
schroneko
67
210k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.9k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
130
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
660
Raft: Consensus for Rubyists
vanstee
141
7.3k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
170
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
89
Designing for Performance
lara
610
70k
Transcript
Questions from Week 3? 1
Week 4: Building APIs Spring 2015 2
Why an API? Allow other applications to interface with our
services Useful for data driven development 3
REST API Data Formats JSON JavaScript Object Notation MIME type:
application/json XML Extensible Markup Language MIME type: application/xml and text/xml 4
JSON Example { "shorturl": "lf64kr", "user": { "id": 2, "name":
"benwoodall", "email": "
[email protected]
" }, "array": [1,3,5,7] } 5
XML Example <?xml version="1.0" encoding="UTF-8" ?> <root> <shorturl>lf64kr</shorturl> <user> <id>2</id>
<name>benwoodall</name> <email>
[email protected]
</email> </user> <array>1</array> <array>3</array> <array>5</array> <array>7</array> </root> 6
Building an API in Shortener 7
We need an API end-point to create short urls Requests
should be authenticated against 8 What do we know so far?
Tests 9 spec/controllers/api/v1/links_controller_spec.rb
respond_to 10
respond_to 11
Namespacing 12 config/routes.rb
Namespacing 13 config/routes.rb app/controllers/api/base_controller.rb
Namespacing 14 config/routes.rb app/controllers/api/base_controller.rb app/controllers/api/v1/links_controller.rb
Testing 15 spec/controllers/api/v1/links_controller_spec.rb
Creating a Link 16 app/controllers/api/v1/links_controller.rb
Authenticating 17 app/controllers/api/base_controller.rb
Authenticating 18
Authenticating 19
Authenticating 20 app/models/user.rb
Views 21 app/views/settings/index.html.erb
JBuilder 22 app/views/api/v1/links/show.html.erb
Questions? 23