Questions tagged [spring-resttemplate]

204 questions
1
vote
1 answer

Using WebClient with block() and RestTemplate is same?

from what I understand about Web Client is it's non blocking meaning the client does not need to wait till the response arrives and can do other tasks parallelly But then using block() in Web Client supports requests synchronously is there any …
1
vote
1 answer

Is it possible to use resttemplate to upload file in azure blob storage - Java

Is there a way to upload files to Azure blob storage using rest template in Java - Spring framework ? I see all examples using SDK and it was successful but we are told not to use SDK - Java. I know question is 10,000 feet high, but any…
Wafa Saba
  • 101
  • 1
  • 9
1
vote
0 answers

Best way to Proxify and consume shared REST APIs between spring-boot modules

I'm working on a big project with many modules, where every API endpoint is regrouped as separated modules and described in interfaces. For the moment we're using a Jersey WebResourceFactory which enable us to create a client-side representation of…
Dragomitch
  • 15
  • 2
  • 6
1
vote
1 answer

Mockito: Verify if restTemplate.exchange() is called

i try to test my SpringBoot application with Mockito. Is it possible to check if a restTemplate.exchange() method is called n times? For example: verify(restTemplate, times(1)) .exchange(myURL, method, requestEntity, responseType)
ab22
  • 27
  • 5
1
vote
0 answers

Java restTemplate and response charset

I am having some troubles using restTemplates. I am posting some JSON and I expect some plain text as a response. I wrote some code to do so, but the response I am getting is not readable (栀琀琀瀀猀㨀⼀⼀愀眀猀甀愀琀 ㄀⸀ as an example.) When I use PostMan with…
giovandrea
  • 197
  • 1
  • 4
  • 13
1
vote
1 answer

Is there any example source code in spring boot and feign available for calling docusign eSignature REST API directly and not use an SDK?

I am trying to implement a spring boot application with DocuSign for getting all Envelopes and generating signing ceremony URL links for individual Envelopes which will be displayed in my app to the signer. I am not able to do it because I am not…
riza446
  • 43
  • 1
  • 7
1
vote
1 answer

Mock RestTemplate return null

I need to mock restTemplate for a simple request: HttpEntity request = new HttpEntity<>(new RequestVO(),new HttpHeaders()); restTemplate.postForEntity("URL", request , ResponseVO.class); But I'm getting null on postForEntity…
Ori Marko
  • 56,308
  • 23
  • 131
  • 233
1
vote
1 answer

How to used Mockito for restTemplateBuilder in Spring Boot

I have a spring rest consumer as below. In this service, we need to use another autowired service. How to mock the response for the restTemplate? @Service public class TestConsumer { private final RestTemplate restTemplate; @Autowired …
tony
  • 91
  • 1
  • 8
1
vote
0 answers

Springboot RestTemplate - Unexpected end of file from server

I have two services A and B where Service A is trying to get the json data from the Service B. When data is less for example 10KB the call ends without any exception. But when the data is around 100MB it gives an error java.net.SocketException:…
skc
  • 65
  • 7
1
vote
0 answers

POST Request Works in Postman but not properly with RestTemplate - SpringBoot

I'm using RestTemplate to get the response body was encrypted or else not properly showing (it's working properly till yesterday, but today this problem occurred without changing any code). But when I hit the API in Postman it's getting the proper…
1
vote
1 answer

SignatureDoesNotMatch error using restTemplate to get url request of S3

I'm trying to send a HTTP GET request of S3 using restTemplate and I get SignatureDoesNotMatch error: The request signature we calculated does not match the signature you provided. Check your key and signing method. Dose anyone know what can cause…
Limor_Sh
  • 31
  • 4
1
vote
1 answer

Call Rest end point with concurrent request

"url":"https://asia-east2-jsondoc.cloudfunctions.net/function-1?delay=1000" //url that takes 1000 ms to return "isParallel": true, "count": "3" isParallel = true means make parallel calls, false means – make a sequential call, count…
1
vote
0 answers

JAVA RestTemplate - Response string is not properly displaying when the response encoding is UTF-16

I have tried to use RestTemplate for consuming a REST api. The response is not getting parsed or displayed in the case of response is using utf-16 encoding. I have tried different options but failed to get the response. Please find the response…
vineethpj
  • 13
  • 1
  • 3
1
vote
1 answer

Spring Boot Rest Response MultipartFile with additional fields

We have a RestController with the below endpoint @PostMapping(path = "/downloadFile", produces = MediaType.MULTIPART_FORM_DATA_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) public FileDownloadResponse…
1
vote
0 answers

What could be a smart solution to create a model object starting from a REST JSON response having different structure? using Spring RestTemplate

I am working on a Spring Boot project using RestTemplate in order to perform GET call to an external API in order to retrieve information. I have the following situation and a doubt about what could be a smart and elegant way to map the field of the…
AndreaNobili
  • 40,955
  • 107
  • 324
  • 596
1 2
3
13 14