Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java responseentity

@GetMapping("/hello")
ResponseEntity<String> hello() {
    return new ResponseEntity<>("Hello World!", HttpStatus.OK);
}
Comment

java responseentity

@GetMapping("/customHeader")
ResponseEntity<String> customHeader() {
    HttpHeaders headers = new HttpHeaders();
    headers.add("Custom-Header", "foo");
        
    return new ResponseEntity<>(
      "Custom header set", headers, HttpStatus.OK);
}
//Simple way
@GetMapping("/hello")
ResponseEntity<String> hello() {
    return ResponseEntity.ok("Hello World!");
}
Comment

PREVIOUS NEXT
Code Example
Java :: create new empty list java 
Java :: java download image file 
Java :: Delete end element in string java 
Java :: setting scale to big decimal java 
Java :: cls java 
Java :: spring boot default value false 
Java :: how to cast from int to string java 
Java :: string vs stringbuffer 
Java :: Java print class type 
Java :: logical operators in java 
Java :: collatz conjecture 
Java :: measure running time of a statement java 
Java :: number of digits java 
Java :: terminate a frame java 
Java :: start activity for result deprecate 
Java :: android application manifest 
Java :: javafx main class 
Java :: java mongodb find with multiple conditions 
Java :: java base64 
Java :: send data from service to activity class 
Java :: java currency format 
Java :: how to convert primitive int to Integer in java 
Java :: blurview android github 
Java :: java get number of months between two dates 
Java :: max and min array number in java 
Java :: java regex case insensitive 
Java :: Android Bitmap to Base64 String 
Java :: linkedhashmap in java 
Java :: java end scripting 
Java :: Java program to print decimal to octal conversion 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =