11use http:: Extensions ;
22use reqwest:: header:: { HeaderMap , HeaderName , HeaderValue } ;
33use reqwest:: { Body , Client , IntoUrl , Method , Request , Response } ;
4- use serde:: Serialize ;
54use std:: convert:: TryFrom ;
65use std:: fmt:: { self , Display } ;
76use std:: sync:: Arc ;
@@ -440,6 +439,7 @@ impl RequestBuilder {
440439 }
441440 }
442441
442+ #[ cfg( feature = "query" ) ]
443443 /// Modify the query string of the URL.
444444 ///
445445 /// Modifies the URL of this request, adding the parameters provided.
@@ -458,13 +458,14 @@ impl RequestBuilder {
458458 /// # Errors
459459 /// This method will fail if the object you provide cannot be serialized
460460 /// into a query string.
461- pub fn query < T : Serialize + ?Sized > ( self , query : & T ) -> Self {
461+ pub fn query < T : serde :: Serialize + ?Sized > ( self , query : & T ) -> Self {
462462 RequestBuilder {
463463 inner : self . inner . query ( query) ,
464464 ..self
465465 }
466466 }
467467
468+ #[ cfg( feature = "form" ) ]
468469 /// Send a form body.
469470 ///
470471 /// Sets the body to the url encoded serialization of the passed value,
@@ -492,7 +493,7 @@ impl RequestBuilder {
492493 ///
493494 /// This method fails if the passed value cannot be serialized into
494495 /// url encoded format
495- pub fn form < T : Serialize + ?Sized > ( self , form : & T ) -> Self {
496+ pub fn form < T : serde :: Serialize + ?Sized > ( self , form : & T ) -> Self {
496497 RequestBuilder {
497498 inner : self . inner . form ( form) ,
498499 ..self
@@ -511,30 +512,13 @@ impl RequestBuilder {
511512 /// fail, or if `T` contains a map with non-string keys.
512513 #[ cfg( feature = "json" ) ]
513514 #[ cfg_attr( docsrs, doc( cfg( feature = "json" ) ) ) ]
514- pub fn json < T : Serialize + ?Sized > ( self , json : & T ) -> Self {
515+ pub fn json < T : serde :: Serialize + ?Sized > ( self , json : & T ) -> Self {
515516 RequestBuilder {
516517 inner : self . inner . json ( json) ,
517518 ..self
518519 }
519520 }
520521
521- /// Disable CORS on fetching the request.
522- ///
523- /// # WASM
524- ///
525- /// This option is only effective with WebAssembly target.
526- ///
527- /// The [request mode][mdn] will be set to 'no-cors'.
528- ///
529- /// [mdn]: https://developer.mozilla.org/en-US/docs/Web/API/Request/mode
530- #[ deprecated( note = "Deprecated Upstream" ) ]
531- pub fn fetch_mode_no_cors ( self ) -> Self {
532- RequestBuilder {
533- inner : self . inner . fetch_mode_no_cors ( ) ,
534- ..self
535- }
536- }
537-
538522 /// Build a `Request`, which can be inspected, modified and executed with
539523 /// `ClientWithMiddleware::execute()`.
540524 pub fn build ( self ) -> reqwest:: Result < Request > {
0 commit comments