File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,11 @@ impl Client {
7070 self . request ( Method :: Put , url)
7171 }
7272
73+ /// Convenience method to make a `PATCH` request to a URL.
74+ pub fn patch < U : IntoUrl > ( & self , url : U ) -> RequestBuilder {
75+ self . request ( Method :: Patch , url)
76+ }
77+
7378 /// Convenience method to make a `DELETE` request to a URL.
7479 pub fn delete < U : IntoUrl > ( & self , url : U ) -> RequestBuilder {
7580 self . request ( Method :: Delete , url)
@@ -511,6 +516,16 @@ mod tests {
511516 assert_eq ! ( r. url, Url :: parse( some_url) ) ;
512517 }
513518
519+ #[ test]
520+ fn basic_patch_request ( ) {
521+ let client = Client :: new ( ) . unwrap ( ) ;
522+ let some_url = "https://google.com" ;
523+ let r = client. patch ( some_url) ;
524+
525+ assert_eq ! ( r. method, Method :: Patch ) ;
526+ assert_eq ! ( r. url, Url :: parse( some_url) ) ;
527+ }
528+
514529 #[ test]
515530 fn basic_delete_request ( ) {
516531 let client = Client :: new ( ) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments