• Skip to primary navigation
  • Skip to content
  • Skip to primary sidebar
Clean Programmer

Clean Programmer

Programming & DevOps Resources

  • Home
  • Library
  • About
  • Contact

rest

Making a GET request with request body using Spring RestTemplate

October 24, 2018 Monzurul Haque Shimul

Yesterday, I had the task to call some rest endpoints for a backend application. The backend application was a spring boot application and so I used the spring RestTemplate to call the service endpoints. The endpoint was consists of several requests with type GET, POST, DELETE. Everything was running fine except one, when I tried to make a GET request that has request body.

This was a GET request, that used the body to transport data. GET requests should pass data in form of request parameters, query strings or header information. It does not make sense, to use the body for get requests. Springs RestTemplate did think the same and did not send the data along with in the request, because GET requests should have request parameters not body entities. I was not able to change the rest service backend, as I was just a consumer and needed to get this going. So I needed to modify RestTemplate behavior to support this.

In this post, I will show how to use RestTemplate to make a GET request that has a request body.

Read More about Making a GET request with request body using Spring RestTemplate

Spring java java-ee rest rest-template spring

Primary Sidebar

Categories

  • Apache Kafka
  • Druid
  • Git
  • Java
  • Java EE
  • Redis
  • Spring
  • Uncategorized
  • Weblogic
  • Wildfly

Featured Posts

Generating Fibonacci sequence using Java Stream API

How to deploy applications to WildFly using jboss-cli

Configure Druid to Use Lookups from JSON File

How to configure JMS in WildFly

Deploy applications to WildFly server using wildfly maven plugin

Tags

bash bitbucket cassandra cloudserver curl docker druid.io eclipselink ejb git imply.io java java-ee jaxws jboss jboss-cli jdbc jdk jms kafka maven minio mssql mysql ojdbc oracle postgresql redis rest rest-template S3 scality sdk sdkman soap spring sqlserver stream stream api weblogic web services wildfly wsdl zenko zookeeper

Archives

  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • June 2018
  • May 2018

Copyright © 2019 · CLEAN PROGRAMMER

  • Privacy Policy
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OKNoRead more
Revoke Cookies