1+ import org .springframework .util .MultiValueMap ;
12import org .springframework .web .client .RestTemplate ;
23import org .springframework .http .RequestEntity ;
34import org .springframework .http .ResponseEntity ;
@@ -41,14 +42,22 @@ protected void doGet(HttpServletRequest request2, HttpServletResponse response2)
4142 restTemplate .execute (fooResourceUrl , HttpMethod .POST , null , null , "test" );
4243 }
4344 {
44- ResponseEntity < String > response =
45- restTemplate .getForEntity (fooResourceUrl , String .class , "test" );
45+ String response =
46+ restTemplate .getForObject (fooResourceUrl , String .class , "test" );
4647 }
4748 {
4849 String body = new String ("body" );
50+ URI uri = new URI (fooResourceUrl );
4951 RequestEntity <String > requestEntity =
50- RequestEntity .post (new URI ( fooResourceUrl ) ).body (body );
52+ RequestEntity .post (uri ).body (body );
5153 ResponseEntity <String > response = restTemplate .exchange (requestEntity , String .class );
54+ RequestEntity .get (uri );
55+ RequestEntity .put (uri );
56+ RequestEntity .delete (uri );
57+ RequestEntity .options (uri );
58+ RequestEntity .patch (uri );
59+ RequestEntity .head (uri );
60+ RequestEntity .method (null , uri );
5261 }
5362 {
5463 String response = restTemplate .patchForObject (fooResourceUrl , new String ("object" ),
@@ -68,6 +77,23 @@ protected void doGet(HttpServletRequest request2, HttpServletResponse response2)
6877 {
6978 restTemplate .put (fooResourceUrl , new String ("object" ));
7079 }
80+ {
81+ URI uri = new URI (fooResourceUrl );
82+ MultiValueMap <String , String > headers = null ;
83+ java .lang .reflect .Type type = null ;
84+ new RequestEntity <String >(null , uri );
85+ new RequestEntity <String >(headers , null , uri );
86+ new RequestEntity <String >("body" , null , uri );
87+ new RequestEntity <String >("body" , headers , null , uri );
88+ new RequestEntity <String >("body" , null , uri , type );
89+ new RequestEntity <String >("body" , headers , null , uri , type );
90+ }
91+ {
92+ URI uri = new URI (fooResourceUrl );
93+ restTemplate .delete (uri );
94+ restTemplate .headForHeaders (uri );
95+ restTemplate .optionsForAllow (uri );
96+ }
7197 } catch (org .springframework .web .client .RestClientException | java .net .URISyntaxException e ) {}
7298 }
7399}
0 commit comments