Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Well shit.
Recently refactored some backend code that makes some https requests.
I realized I was repeating myself a lot with the request options so I decided to make a function to generate the options with defaults.
Works great, shortened my requests to almost nothing.
The problem is it wasn't working great.
It took me about an hour to finally figure out that the requests were failing because I forgot to return the options object after I created it.
Sending the request with null options just makes it act as if the options are there, but incorrect, so I was totally lost.
FML
rant