Skip to main content
Filter by
Sorted by
Tagged with
-1 votes
1 answer
38 views

wrote a utility method as described at BodySubscribers#mapping. static <T, U> HttpResponse.BodyHandler<Supplier<U>> newJsonBodyHandlerDeferred( final HttpResponse....
Jin Kwon's user avatar
  • 22.4k
3 votes
1 answer
160 views

We have java.net.http.WebSocket code that connects to our devices with the wss:// TLS Web Socket protocol successfully under our OpenLiberty Java 17, Java EE (and Spring 5) application, but fails ...
Doug Breaux's user avatar
  • 5,165
0 votes
2 answers
114 views

I'm trying to fetch a json string from a (GraphQL ?) server. The input is a json string + POST request and the ouput is a json document. When using curl, it works (well , let's be honest it works if ...
Pierre's user avatar
  • 35.4k
3 votes
0 answers
97 views

I'm using an API which, for certain large queries, returns a 307 status code and redirects me to a signed AWS S3 URL. I'm querying it with Java's inbuilt HttpClient (java.net.http.HttpClient), and the ...
Rebecca R's user avatar
0 votes
1 answer
300 views

I've found that my Java Micronaut application, which essentially makes a blocking HTTP-call, handles low load well. But if the amount of requests increase, the application falls in a patter that looks ...
Simon's user avatar
  • 90
1 vote
0 answers
78 views

I'm developing a tool based on Apache Jena 4.9.0 libraries to issue SELECT queries to a SPARQL endpoint, and execution resulted in error stated at the title (that is, "Endpoint returned Content-...
Yasunori's user avatar
0 votes
1 answer
185 views

I'm currently writing a program that has to fetch files from one API and send them to another one. I thought it would be nice to just take the byte stream and stream it directly from the response into ...
xtay2's user avatar
  • 996
0 votes
0 answers
104 views

I want to get data from a server that sends chunked data, in my case line by line. I checked this answer suggesting a custom BodySubscriber, as well as this one resorting to an InputStream. My current ...
stwissel's user avatar
  • 20.5k
2 votes
3 answers
684 views

I'm trying to use configured host-specific outbound SSL configuration in OpenLiberty to make an https connection to a remote system (Apple Pay, in this case, but I don't think relevant). I know the ...
Doug Breaux's user avatar
  • 5,165
0 votes
1 answer
311 views

Apache's HttpClient provides mechanism to keep the socket alive. SocketConfig socketConfig = SocketConfig.custom().setSoKeepAlive(true).build(); new PoolingHttpClientConnectionManager()....
forumUsr's user avatar
1 vote
0 answers
182 views

I'm creating a client-server application where an HTTP 1.1 server sends an arbitrary number of binary packets to the client in a single HTTP response. The size of a response body may be as large as ...
Андрей Щеглов's user avatar
1 vote
0 answers
509 views

I'm interested in starting to use the Idea Http Client for API testing. I'm currently facing a challenge. I have a set of requests or a sequence of requests that I would like to execute within other ...
thevasssa's user avatar
2 votes
1 answer
602 views

I know you can set keep-alive by using System property jdk.httpclient.keepalive.timeout, and this value is only read once when the class jdk.internal.net.http.ConnectionPool is loaded. Afterwards, it ...
Patrick's user avatar
  • 377
1 vote
0 answers
167 views

Currently using the Java 11 HttpClient to make http requests and it appears there isn't an obvious way to read response trailers. These responses are streamed back to the client - the Java 11 ...
LooneyTuunz's user avatar
3 votes
1 answer
928 views

We ran into same similar issue like: Java 11/17 HttpClient - How to try several IPs behind one hostname? We have a Linux box that has localhost IP address (127.XX.XX.XX) followed by the internal IP ...
forumUsr's user avatar
1 vote
1 answer
95 views

How can I access authenticated Virtuoso OpenSource SPARQL 1.1. graph store protocol through Jena 4? I am facing this problem after having upgraded my codebase from Jena 3 (Apache HttpClient) to Jena 4 ...
Petr Křemen's user avatar
0 votes
1 answer
721 views

I am sending a HTTP REST GET request to an API with standard Java 17 like this : HttpResponse<String> response = httpClient.send(request, BodyHandlers.ofString()); and I can see the with ...
Stanislav Ivanov's user avatar
0 votes
0 answers
148 views

I'm implementing an app to fetch requests from a website API that seems to be protected by Cloudfare. When I make requests to the API using Java HttpClient framework, I get the following response (I'...
Hedayat Mahdipour's user avatar
-1 votes
1 answer
203 views

I want to add header in my HTTPRequest with variable but it will give error not taking it but when i pass direct string value in inverted commas it work well. Hers is the code in 3rd header i am ...
Naved Ahmed's user avatar
20 votes
1 answer
6k views

I'm using Java Corretto 21.0.0.35.1 build 21+35-LTS, and the built-in Java HTTP client to retrieve a response as an InputStream. I'm making parallel requests using virtual threads, and for the most ...
Urb's user avatar
  • 263
1 vote
2 answers
852 views

I use java.net.http.HttpClient to download a large file. How can I make HttpClient report the progress of the download? For example, can it call a callback every X byte that it has finished ...
Lii's user avatar
  • 12.2k
2 votes
1 answer
83 views

I'm trying to download an asset inside a GitHub release as a file, but the response is empty. The repository is private, but I have a working bearer token with which I can perform other calls. static ...
A. M.'s user avatar
  • 31
1 vote
3 answers
2k views

When using rest template we can handle response statuses other than 200 based on the exception thrown by resttemplate. This article describes this in detail. By default, the RestTemplate will throw ...
CodeBot's user avatar
  • 185
1 vote
2 answers
931 views

I'm using Java 11 HttpClient to send request to a remote server. I wanted to know if there is a difference on the HttpClient object when creating object in below 2 different ways HttpClient client = ...
Kaustubh Hande's user avatar
-1 votes
1 answer
1k views

I currently have a JSON request body as a string that I am also passing as a string in the BodyPublishers.ofString() method when using the java httpclient to send a POST request. I also want to be ...
wheelerlc64's user avatar
0 votes
0 answers
165 views

Im trying to upload a file to a JIRA task using the Java 11 HttpClient. But getting org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException: the request doesn't contain a multipart/...
VinodKhade's user avatar
5 votes
0 answers
672 views

How can I configure Java's own "new" (Java 9/11/17) HttpClient to try more than the first found IP adress behind a hostname? There are (at least) two scenarios: A server with IPv4 and IPv6 ...
Dirk Hillbrecht's user avatar
2 votes
0 answers
587 views

Currently, I have this JsonBodyHandler used to parse the response body if the response is successful. I also have a model defined if the request is not successful. So based on the status code, I need ...
Keshavram Kuduwa's user avatar
0 votes
1 answer
96 views

I'm using Android Studio Electric Eel | 2022.1.1 for a school project and I need to use an API. In order to use the API I need to send an HTTP request to a certain URL. I read about java 11's ...
eladGN's user avatar
  • 13
1 vote
3 answers
2k views

I am calling an external API using HttpClient as below, HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder().uri(URI.create("http://localhost:8080/...
BSM's user avatar
  • 183
1 vote
1 answer
2k views

I am using Java 17. I am trying to get the response from a message service and create a map object. Then send it to the caller method. I am using java.net.http. I am willing to use a callback so that ...
Sumon Bappi's user avatar
  • 2,019
0 votes
2 answers
3k views

I am trying to stream response(word by word) of chatgpt api in android (java) by implementing async task but i get an error. I am using java's HTTPurlconnection library with input and outputstreams so ...
Calt Channel's user avatar
1 vote
1 answer
925 views

is there a good way to generate curl from java.net.http.HttpRequest? It seems like there is no good way to get the body (if there is a body), the closest thing to it is bodyPublisher() that returns ...
Roy Ash's user avatar
  • 1,126
1 vote
1 answer
2k views

I made a Java program to check whether a web request will redirect or not. As there are some status codes in HTTP protocol, I need to look for 302 status code that expresses redirect request, Here is ...
LakshyaK2011's user avatar
0 votes
0 answers
332 views

I am running a Java 11 SDK program through IntelliJ IDEA (on Widows 10) which is using the Java 11 Httpclient to send a simple GET request to a site that has a self-signed certificate. final ...
user742925's user avatar
1 vote
1 answer
879 views

I'm working on an simple android kotlin project which use the build-in java.net.http.HttpClient to make http post request, but it always failed to build, the error is: Unresolved reference: http ...
jinreal's user avatar
  • 1,590
0 votes
1 answer
373 views

I'm trying to get info from https://prices.runescape.wiki/api/v1/osrs/latest HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder() ...
rairai's user avatar
  • 35
0 votes
1 answer
514 views

I'm trying to make a HTTP Request using Java 11 HttpClient and after receiving an access token I'm getting a 403 error. Here's a coding snippet, after receiving a valid token: HttpClient httpClient = ...
SpaceBoundRocket's user avatar
0 votes
1 answer
2k views

I'm a bit inexperienced with Java so that may be my main issue but I'm trying to make an API request to an API that was generated by AWS's API Gateway. The API can only be executed by specific IAM ...
dredbound's user avatar
  • 1,699
0 votes
0 answers
52 views

I have a URL from a third party so no option of removing the nasty characters. For security purposes I have put a dummy company in mybadurl.com and also replaced the account number with AccountNo. ...
Sankster's user avatar
2 votes
3 answers
3k views

I'm using java.net.http.HttpClient.newHttpClient() under Java 19 (Temurin) and perform sendAsync(...) requests from different treads on the same instance. I assume this is ok, as the javadoc states: ...
Itchy's user avatar
  • 2,464
1 vote
0 answers
265 views

ByteArrayDataSource datasource = new ByteArrayDataSource(in, "multipart/form-data"); MimeMultipart multipart = new MimeMultipart(datasource); int count = multipart.getCount(); log.debug(&...
Sharath K's user avatar
0 votes
0 answers
220 views

I have the following code: import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; ...
Roy Ash's user avatar
  • 1,126
0 votes
0 answers
1k views

I created a WebSocket server using Java Spring, which worked correctly when connecting via ws://localhost:8080/socket and ws://localhost:30019/socket. However, when I attempt to upload the socket to ...
KingsDev's user avatar
  • 667
1 vote
1 answer
256 views

I have a server which replies first with status code 103 ( and some headers) and then with 200 ( plus some other headers) curl -I output below: HTTP/2 103 link: <https://cdn.shopify.com>; rel=...
humbletrader's user avatar
0 votes
1 answer
770 views

I am writing java HttpClient code, to query splunk API, and get search id (sid) as output. I was able to write this in curl and python, with no issues. But Java is proving to be difficult. Curl: (...
gvk's user avatar
  • 15
0 votes
0 answers
781 views

I have an API that process a lot of information by calling another API. So for example, when the process starts in the API A, it makes a lot of http requests do the API B. It works fine for most ...
Gustavo Cesário's user avatar
2 votes
1 answer
704 views

I am looking for a Java HTTP Async client which can be used to get performance metrics like TCP connection time, Time to first byte, TLS handshake time for an endpoint. I looked into latest java.net....
Mary123's user avatar
  • 41
0 votes
1 answer
689 views

I'm trying to write a simple HTTP Client & Server using the new (JDK 11) HttpClient. JDK.: OpenJDK 17.0.0 The Client is connecting to the Server but doesn't seem to be POST'ing any data. After the ...
Dave The Dane's user avatar
1 vote
1 answer
636 views

I am trying to setup a HttpClient to proxy requests through a HTTPS authenticated proxy. It seems the Java HttpClient can only proxy over http and therefore the proxy credentials are sent in plaintext ...
donal's user avatar
  • 13

1
2 3 4 5