Skip to content

Instantly share code, notes, and snippets.

@ksurendra
Created March 26, 2020 21:36
Show Gist options
  • Save ksurendra/40793feac5888b57368957df63e37d47 to your computer and use it in GitHub Desktop.
Save ksurendra/40793feac5888b57368957df63e37d47 to your computer and use it in GitHub Desktop.
Sample controller to print API values in browser
package com.engg.java.reactive;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.GetMapping;
@RestController
public class TestController {
@GetMapping
public String sample() {
ReqResWebClient webClient = new ReqResWebClient();
return "<html><body><h1>Java Spring Webclient Example</h1><br><br>" +
webClient.getResult() + "<br>" +
webClient.getUser1() + "<br>" +
webClient.getUser2() +
"</body></html>";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment