Giter Club home page Giter Club logo

Comments (4)

fafhrd91 avatar fafhrd91 commented on July 18, 2024

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.

nanakura avatar nanakura commented on July 18, 2024

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.

fafhrd91 avatar fafhrd91 commented on July 18, 2024

you can try Body::Stream and this method https://docs.rs/ntex/latest/ntex/http/struct.ResponseHead.html#method.no_chunking

from ntex.

nanakura avatar nanakura commented on July 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.