Comments (2)
Hi @leopiccionia. Nice spot! You can directly respond null
to get native null
as the result. But i think we can improve the behavior. Do you mind to share exact curl -Iv [URL]
output of your API? What are Content-Type
and Content-Length
for API routes?
from ofetch.
It's for a third-party REST API that requires an API key, etc. So it's hard to setup a proper reproduction. My source code is here, though.
For context, it's a DELETE
REST endpoint, that returns nothing on success (204 No Content
) or a JSON object on failure.
I could extract the following headers from $fetch.raw
:
{
'access-control-allow-origin': '*',
connection: 'close',
'content-type': 'application/json; charset=UTF-8',
date: 'Sat, 04 Jun 2022 16:27:11 GMT',
server: 'nginx'
}
from ofetch.
Related Issues (20)
- Pick function HOT 1
- Typed API definition HOT 12
- Response does not contain headers HOT 2
- Receiving server-sent events (SSE) HOT 2
- Failed to upload Mega-sized base64 image HOT 1
- Go-like syntax to handle errors HOT 6
- error.statusText & error.statusMessage are undefined after Nuxt build but are set in dev
- deprecate `params` alias for `query` HOT 1
- the HTTP(S) Agent invalid HOT 7
- Can access to typed data in interceptors HOT 2
- Set cookies HOT 11
- error on Response.blob()
- Multipart image upload not working with fetch but with RapidAPI HOT 3
- Missing types in node export HOT 1
- `body` vs `params` option HOT 1
- Inconsistent headers object returned after a retried request
- TS2305: Module 'ofetch' has no exported member FetchOptions HOT 1
- Errors in Interceptors are silently handled
- How to handle errors body HOT 1
- GraphQL Support HOT 2
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 ofetch.