heyile edited a comment on issue #1602: 请教,highway通信模式下是否可以指定ip访问特定实例的接口
URL: 
https://github.com/apache/servicecomb-java-chassis/issues/1602#issuecomment-593751042
 
 
   Provider:
   
   ```java
   
     @RequestMapping(path = "/sayhi", method = RequestMethod.POST, produces = 
"text/plain")
     public String sayHi(@RequestParam(name = "name", defaultValue = "test") 
String name) {
       return "Hello " + name;
     }
   
   ```
   
   Consumer:
   
   ```java
       String sayHiResult =
           
restTemplate.postForObject("cse://springmvc/springmvchello/sayhi?name=Java 
Chassis", null, String.class);
       Assertion.assertEquals("Hello Java Chassis", sayHiResult);
   
       String sayHiResult2 =
           
restTemplate.postForObject("http://localhost:8080/springmvchello/sayhi?name=Java
 Chassis", null, String.class);
       Assertion.assertEquals("Hello Java Chassis", sayHiResult2);
   
   
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to