Comments (4)
why do you need this?
what should be ntex behavior in your example? ntex supports pipelining, but if your example would be allowed it would broke pipelining.
from ntex.
why do you need this?
what should be ntex behavior in your example? ntex supports pipelining, but if your example would be allowed it would broke pipelining.
The HEAD request only uses the header to pass information. I need to set the content-length in the HEAD request. This is the information I want to pass, but the content-length will be overwritten.
use ntex::web;
#[web::head("/")]
async fn hello() -> impl web::Responder {
web::HttpResponse::Ok().set_header("Content-Length", 1000).finish()
}
#[ntex::main]
async fn main() -> std::io::Result<()> {
web::HttpServer::new(|| {
web::App::new()
.service(hello)
})
.bind(("127.0.0.1", 8080))?
.run()
.await
}
from ntex.
you can try Body::Stream and this method https://docs.rs/ntex/latest/ntex/http/struct.ResponseHead.html#method.no_chunking
from ntex.
you can try Body::Stream and this method docs.rs/ntex/latest/ntex/http/struct.ResponseHead.html#method.no_chunking
got it
from ntex.
Related Issues (20)
- Please respect semantic versioning HOT 1
- 23Q4 Performance Regressions as Revealed in TechEmpower Results HOT 5
- compilation error below, how to resolve? HOT 2
- async-graphql integration example? HOT 2
- `ntex::time::timeout` is not accurate HOT 3
- Moving websocket to a feature HOT 3
- [ntex-server](Bug) Duplicates ctrlc_handler registration under win causing process crash HOT 2
- Program panicks upon ctrl+c HOT 3
- Wrong feature gate in ntex/ntex-net/src/compat.rs HOT 1
- Ntex runtime panic HOT 20
- How to convert web::types::Payload to AsyncRead HOT 1
- Is there a feature comparison with other frameworks ? HOT 1
- The `insert` method for `Extensions` does not return existed value HOT 1
- Compilation failed for windows HOT 2
- http client closes h2 connection HOT 1
- Can't access state in middleware HOT 6
- Ntex is a masterpiece ! SALUTE !!
- Causing the socket to not close HOT 5
- Help: How to return errors during serde serialization and deserialization 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 ntex.