Skip to content

Do an HTTP GET using Spring Framework RestTemplate

Notifications You must be signed in to change notification settings

tanbinh123/HttpGetSpring

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

HttpGetSpring

Do an HTTP GET from a URL using Spring Framework RestTemplate.

See REST in Spring 3: RestTemplate for tutorial and examples.

Spring uses the HttpClient from Apache HttpComponents for the HTTP requests.

Build

Build with Maven.

mvn clean install

Produces an executable .jar file

/target/HttpGetSpring.jar

Run

java -jar HttpGetSpring.jar

Options

usage: java -jar httpGetTest.jar url [-h] [-o <filename>] [-v]

Do an HTTP GET from a URL

 -h,--help                Show this help
 -o,--output <filename>   output file
 -v,--verbose             show HTTP headers and processing messages

Examples:

  java -jar httpGetTest.jar https://someurl.com/get/stuff

  java -jar httpGetTest.jar -o myfile.txt https://someurl.com/get/stuff

About

Do an HTTP GET using Spring Framework RestTemplate

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%