Comments (3)
Hey, thank you
The earliest versions of this didn't reject on 400+. I used it for a bit and tbh I didn't like it. It made testing easy, but I/you inevitably end up adding if blocks or switch statements to react to the status code.
This was far more verbose & annoying in the long run IMO.
I decided to roll with 400+ rejections to follow the HTTP status codea' meaning more closely. Anything above 400 is a non-successful response, which, in userland, translates to an abruption in your "happy path" 99% of the time.
That, to me, almost exactly describes a catch
Sounds reasonable?
from httpie.
Yes very true. I used to have this exact thought pattern, but when I started working with the fetch
api I needed to rewire my thinking to the other way. As long as you have this well documented (which you do) then I think you're good to go
from httpie.
Awesome, thank you
from httpie.
Related Issues (20)
- Browser Version HOT 15
- 🙈 Ignore package-lock.json and yarn.lock HOT 3
- WHATWG URL not working HOT 4
- If host is offline HOT 2
- react-native compatibility (Android) HOT 8
- V2 Release Date HOT 1
- How to Timeout requests HOT 3
- Send form-data HOT 2
- Expose RAW Response object HOT 5
- Here is an possibly an error with FormData (v2) HOT 1
- ERR_PACKAGE_PATH_NOT_EXPORTED HOT 2
- next "timeout" doesn't work as expected (i guess)
- Caching support HOT 3
- withCredentials HOT 6
- ESM module for both Node.js and the Browser? HOT 1
- Use of send.bind(send, 'METHOD') prevents tree shaking with Rollup HOT 6
- [next] exports field browser conditional ordering HOT 2
- npm "readme" is totally blank HOT 2
- Ability to abort requests
- Inconsistent response handling in v2 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from httpie.