DEV Community

Discussion on: What's one of the most frustrating moments you've had as a developer?

Collapse
 
missamarakay profile image
Amara Graham

Learning a new API.

In this most recent case, the API devs chose not to ignore trailing slashes. No mention of that anywhere, and seeing as I don't develop APIs myself, I mostly consume them, I never thought this would be an issue as I didn't realize in some frameworks its a setting/flag.

I typically play around with an API in Postman or Advanced Rest Client, start with a simple GET, work my way to something more interesting. This particular API was a new Beta version, using OAuth 2 (new for me at the time), and I was under a tight timeline. All of these things together led to me not paying as close of attention as I usually do.

It looked something like this:

GET /products/item would work fine
GET /products/item/ would fail with what looked like an auth error
GET /products would work fine
GET /products/ would fail with what looked like an auth error

So the pattern looks obvious here, but not so much when I'm just firing off calls in various tabs trying to get things to work and suddenly it looks like my token is invalid.

Absolutely maddening. Now I'm always VERY careful, almost paranoid, about trailing slashes.