@@ -682,7 +682,7 @@ impl Request {
682
682
/// ```
683
683
/// use http_types::{Method, Request, Url};
684
684
///
685
- /// let mut req = Request::get(Url::parse( "https://example.com").unwrap() );
685
+ /// let mut req = Request::get("https://example.com");
686
686
/// req.set_body("Hello, Nori!");
687
687
/// assert_eq!(req.method(), Method::Get);
688
688
/// ```
@@ -704,7 +704,7 @@ impl Request {
704
704
/// ```
705
705
/// use http_types::{Method, Request, Url};
706
706
///
707
- /// let mut req = Request::head(Url::parse( "https://example.com").unwrap() );
707
+ /// let mut req = Request::head("https://example.com");
708
708
/// assert_eq!(req.method(), Method::Head);
709
709
/// ```
710
710
pub fn head < U > ( url : U ) -> Self
@@ -725,7 +725,7 @@ impl Request {
725
725
/// ```
726
726
/// use http_types::{Method, Request, Url};
727
727
///
728
- /// let mut req = Request::post(Url::parse( "https://example.com").unwrap() );
728
+ /// let mut req = Request::post("https://example.com");
729
729
/// assert_eq!(req.method(), Method::Post);
730
730
/// ```
731
731
pub fn post < U > ( url : U ) -> Self
@@ -746,7 +746,7 @@ impl Request {
746
746
/// ```
747
747
/// use http_types::{Method, Request, Url};
748
748
///
749
- /// let mut req = Request::put(Url::parse( "https://example.com").unwrap() );
749
+ /// let mut req = Request::put("https://example.com");
750
750
/// assert_eq!(req.method(), Method::Put);
751
751
/// ```
752
752
pub fn put < U > ( url : U ) -> Self
@@ -766,7 +766,7 @@ impl Request {
766
766
/// ```
767
767
/// use http_types::{Method, Request, Url};
768
768
///
769
- /// let mut req = Request::delete(Url::parse( "https://example.com").unwrap() );
769
+ /// let mut req = Request::delete("https://example.com");
770
770
/// assert_eq!(req.method(), Method::Delete);
771
771
/// ```
772
772
pub fn delete < U > ( url : U ) -> Self
@@ -787,7 +787,7 @@ impl Request {
787
787
/// ```
788
788
/// use http_types::{Method, Request, Url};
789
789
///
790
- /// let mut req = Request::connect(Url::parse( "https://example.com").unwrap() );
790
+ /// let mut req = Request::connect("https://example.com");
791
791
/// assert_eq!(req.method(), Method::Connect);
792
792
/// ```
793
793
pub fn connect < U > ( url : U ) -> Self
@@ -808,7 +808,7 @@ impl Request {
808
808
/// ```
809
809
/// use http_types::{Method, Request, Url};
810
810
///
811
- /// let mut req = Request::options(Url::parse( "https://example.com").unwrap() );
811
+ /// let mut req = Request::options("https://example.com");
812
812
/// assert_eq!(req.method(), Method::Options);
813
813
/// ```
814
814
pub fn options < U > ( url : U ) -> Self
@@ -829,7 +829,7 @@ impl Request {
829
829
/// ```
830
830
/// use http_types::{Method, Request, Url};
831
831
///
832
- /// let mut req = Request::trace(Url::parse( "https://example.com").unwrap() );
832
+ /// let mut req = Request::trace("https://example.com");
833
833
/// assert_eq!(req.method(), Method::Trace);
834
834
/// ```
835
835
pub fn trace < U > ( url : U ) -> Self
@@ -849,7 +849,7 @@ impl Request {
849
849
/// ```
850
850
/// use http_types::{Method, Request, Url};
851
851
///
852
- /// let mut req = Request::patch(Url::parse( "https://example.com").unwrap() );
852
+ /// let mut req = Request::patch("https://example.com");
853
853
/// assert_eq!(req.method(), Method::Patch);
854
854
/// ```
855
855
pub fn patch < U > ( url : U ) -> Self
0 commit comments