← Back to Upcase


(Upcase ) #1
In this week's episode, Chris is joined by Gabe Berke-Williams to discuss all things API, HTTP, and JSON. Tune in to learn the tools, workflows, and approach that Chris, Gabe, and thoughtbot at large use to interact with APIs. Note - This week's ...
This is a companion discussion topic for the original entry at https://thoughtbot.com/upcase/videos/apis-http-json
(Kurt Mueller) #2

How does Thoughtbot typically handle authentication with json apis?

(Anthony Lee) #3

THANK YOU SO MUCH for this weeks weekly iteration! I just feel like I got 30 minutes of private lesson from two Thoughtbot developers. So many awesome tools working with API. I had no idea that you can do stuff with Vim like that. I freaking love UPCASE! Again, thank you guys. This helped so much!

(mbrinkme) #4

Thank you for this Video. It comes up for me at the right time ! I like the json formatting in vim.

(Paul Haddad) #5

Fantastic video! This was a great intro!

(Bruce) #6

+1 this was one of my favorite Upcase videos to date!

(thedanotto) #7

+1 … what’s the best way to test json responses when authentication is required (devise)? Or any tutorials to get started?

@christoomey @gabe @gabebw1 @KurtRMueller

(Chris Toomey) #8

Hi @thedanotto, I’m not sure I fully understand your question. What specifically are you trying to test? I think the authentication aspect would likely be separate and handled however you normally would (helper method in a controller spec to sign_in a user, or similar).

Beyond that, I would expect that you would want to exercise your app, likely through controller specs, and make assertions about the shape of the JSON. You can do this by directly asserting against the returned JSON, or you can go a bit further if you’re using schemas. See the Validating JSON Schemas with an RSpec Matcher post on Giant Robots for a summary of this approach.

Hope this helps, but let me know if you have more specific questions.

(Nick Schwad) #9

Just came here in 2017 and have to agree with all of those above, this is my favorite video to date! I love the amount of tooling that was demonstrated in this video and will definitely be using some of it. The UI with postman has changed slightly since but I would definitely say that it’s all still relevant info. Thanks! :grinning:

(Eliza Mitchell) #10

Just coming in to make some notes about the state of affairs for HTTP Test Applications in 2019. Postman is now an app and no longer a Chrome extension. You can visit their website here. Another really cool thing is that you can interact with their API Network.

Alternatively, if you don’t like Postman, I’ve found great success using Insomnia as my REST client. I use the free version, but like most services these days, there’s a paid tier as well. Insomnia also has a ridiculous amount of features that I haven’t even scratched the surface of yet.