fn request_for(
        uri: hyper::Uri,
        call: scheduler::Call,
        maybe_stream_id: Option<String>,
    ) -> hyper::Request {
        let mut request = hyper::Request::new(hyper::Method::Post, uri);
        request.headers_mut().set(hyper::header::Accept(vec![
            hyper::header::qitem(PROTOBUF_MEDIA_TYPE.clone()),
        ]));
        request
            .headers_mut()
            .set(hyper::header::ContentType(PROTOBUF_MEDIA_TYPE.clone()));
        if let Some(stream_id) = maybe_stream_id {
            request.headers_mut().set(MesosStreamIdHeader(stream_id));
        }

        // TODO: Handle error
        let body = call.write_to_bytes().unwrap();
        request.set_body(body);
        request
    }
/// Construct a Hyper Request object for given URI and Mesos scheduler call.
Construct a Hyper Request object for given URI and Mesos scheduler call.
Construct a Hyper Request object for given URI and Mesos scheduler call .
fn request_for(
        uri: hyper::Uri,
        call: scheduler::Call,
        maybe_stream_id: Option<String>,
    ) -> hyper::Request {
        let mut request = hyper::Request::new(hyper::Method::Post, uri);
        request.headers_mut().set(hyper::header::Accept(vec![
            hyper::header::qitem(PROTOBUF_MEDIA_TYPE.clone()),
        ]));
        request
            .headers_mut()
            .set(hyper::header::ContentType(PROTOBUF_MEDIA_TYPE.clone()));
        if let Some(stream_id) = maybe_stream_id {
            request.headers_mut().set(MesosStreamIdHeader(stream_id));
        }
        // TODO: Handle error
        let body = call.write_to_bytes().unwrap();
        request.set_body(body);
        request
    }
fn request_for ( uri : hyper :: Uri , call : scheduler :: Call , maybe_stream_id : Option < String > , ) -> hyper :: Request { let mut request = hyper :: Request :: new ( hyper :: Method :: Post , uri ) ; request . headers_mut ( ) . set ( hyper :: header :: Accept ( vec ! [ hyper header qitem ( PROTOBUF_MEDIA_TYPE clone ( ) ) ] ) ) ; request . headers_mut ( ) . set ( hyper :: header :: ContentType ( PROTOBUF_MEDIA_TYPE . clone ( ) ) ) ; if let Some ( stream_id ) = maybe_stream_id { request . headers_mut ( ) . set ( MesosStreamIdHeader ( stream_id ) ) ; } // TODO: Handle error let body = call . write_to_bytes ( ) . unwrap ( ) ; request . set_body ( body ) ; request }
Construct a Hyper Request object for given URI and Mesos scheduler call.
Construct a Hyper Request object for given URI and Mesos scheduler call .
uri
hyper::Uri
call
scheduler::Call
maybe_stream_id
Option<String>
uri
hyper::Uri
call
scheduler::Call
maybe_stream_id
Option<String>