Skip to content
Advertisement

Tag: httprequest

Is there a way to get HTTP request parameter using wildcard?

We have a service that get values from formData in http requests. Some parameters are packaging1_1 or packaging1_2 or packaging1_3 etc We are using the following code to get the parameter value from HttpServletRequest request Is there any way to use the code with wildcard in the last number? e.g. Answer No, you can only get all the names and

Microservices communication with optional parameters requests

I have a room service which returns detail for rooms when requesting http://localhost:8082/room/search/byRoomChar Now I want to request this @GetMapping from the booking service since this is the application gateway that users are going to interact with using the http://localhost:8081/booking/search/byRoomChar. Room entity code: Room repository code: However, this does not work because when omitting parameters when calling the getmapping from

java 11 HttpClient send header then body

I want to use Java 11 HttpClient and send header first, check response and if response is OK then send the body. How can I send header only? this is my current code: However with such httpResponse I understand I send the body. Answer By default, the header comes first in requests. What you asked is, The first request with

Initiate download from certain byte

I would like to implement a distributed download manager on android that initiates downloads at certain byte lengths. So this way portions of files can be downloaded instead of only from the beginning to the end of the http request. Nothing innovative about it, I just don’t know how to do it. (It’s not bitorrent either) In java http apache

Add HEADER in HTTP Request in Java

I’m using this following code to send simple HTTP Request : However, as you can see, I don’t send a custom HEADER. What should I add to send a custom HEADER ? Answer When you write The rnrn bit is sending a line-feed/carriage-return to end the line and then another one to indicate that there are no more headers. This

Advertisement