The internal type of the Java wrapped class.
The internal type of the Java wrapped class.
The internal instance of the Java wrapped class.
The internal instance of the Java wrapped class.
If you send an HTTP request with the header Expect
set to the value 100-continue
and the server responds with an interim HTTP response with a status code of 100
and a continue handler
has been set using this method, then the handler
will be called.
If you send an HTTP request with the header Expect
set to the value 100-continue
and the server responds with an interim HTTP response with a status code of 100
and a continue handler
has been set using this method, then the handler
will be called.
You can then continue to write data to the request body and later end it. This is normally used in conjunction with the org.vertx.scala.core.http.HttpClientRequest.sendHead() method to force the request header to be written before the request has ended.
A reference to this, so multiple method calls can be chained.
Set a drain handler on the stream.
Set a drain handler on the stream. If the write queue is full, then the handler will be called when the write queue has been reduced to maxSize / 2. See org.vertx.scala.core.streams.Pump for an example of this being used.
Ends the request.
Ends the request. If no data has been written to the request body, and org.vertx.scala.core.http.HttpClientRequest.sendHead() has not been called then the actual request won't get written until this method gets called.
Once the request has ended, it cannot be used any more, and if keep alive is true the underlying connection will be returned to the org.vertx.scala.core.http.HttpClient pool so it can be assigned to another request.
Same as org.vertx.scala.core.http.HttpClientRequest.end() but writes some data to the request body before ending.
Same as org.vertx.scala.core.http.HttpClientRequest.end() but writes some data to the request body before ending. If the request is not chunked and no other data has been written then the Content-Length header will be automatically set.
Same as org.vertx.scala.core.http.HttpClientRequest.end(Buffer) but writes a String with the specified encoding.
Same as org.vertx.scala.core.http.HttpClientRequest.end(Buffer) but writes a String with the default encoding.
Set an exception handler.
Set an exception handler.
Returns the HTTP headers.
Returns the HTTP headers.
This method converts a Java collection into a Scala collection every time it gets called, so use it sensibly.
The HTTP headers.
Checks whether the request is chunked.
Checks whether the request is chunked.
True if the request is chunked.
Put an HTTP header - fluent API.
Put an HTTP header - fluent API.
The header name
The header values
A reference to this, so multiple method calls can be chained.
Forces the head of the request to be written before org.vertx.scala.core.http.HttpClientRequest.end() is called on the request or any data is written to it.
Forces the head of the request to be written before org.vertx.scala.core.http.HttpClientRequest.end() is called on the request or any data is written to it. This is normally used to implement HTTP 100-continue handling, see org.vertx.scala.core.http.HttpClientRequest.continueHandler(org.vertx.java.core.Handler) for more information.
A reference to this, so multiple method calls can be chained.
If chunked is true then the request will be set into HTTP chunked mode.
If chunked is true then the request will be set into HTTP chunked mode.
True if you want the request to be in chunked mode.
A reference to this, so multiple method calls can be chained.
Sets the amount of time after which if a response is not received TimeoutException() will be sent to the exception handler of this request.
Sets the amount of time after which if a response is not received TimeoutException() will be sent to the exception handler of this request. Calling this method more than once has the effect of canceling any existing timeout and starting the timeout from scratch.
The quantity of time in milliseconds.
A reference to this, so multiple method calls can be chained.
Set the maximum size of the write queue to maxSize
.
Set the maximum size of the write queue to maxSize
. You will still be able to write to the stream even
if there is more than maxSize
bytes in the write queue. This is used as an indicator by classes such as
Pump
to provide flow control.
Helper method wrapping invocations and returning the Scala type, once again to help provide fluent return types
Helper method wrapping invocations and returning the Scala type, once again to help provide fluent return types
Write a java.lang.String to the request body, encoded using the encoding enc
.
Write a java.lang.String to the request body, encoded using the encoding enc
.
A reference to this, so multiple method calls can be chained.
Write a java.lang.String to the request body, encoded in UTF-8.
Write a java.lang.String to the request body, encoded in UTF-8.
A reference to this, so multiple method calls can be chained.
Write some data to the stream.
Write some data to the stream. The data is put on an internal write queue, and the write actually happens asynchronously. To avoid running out of memory by putting too much on the write queue, check the org.vertx.scala.core.streams.WriteStream.writeQueueFull() method before writing. This is done automatically if using a org.vertx.scala.core.streams.Pump.
This will return true
if there are more bytes in the write queue than the value set using
org.vertx.scala.core.streams.WriteStream.setWriteQueueMaxSize()
This will return true
if there are more bytes in the write queue than the value set using
org.vertx.scala.core.streams.WriteStream.setWriteQueueMaxSize()
Represents a client-side HTTP request.
Instances are created by an org.vertx.scala.core.http.HttpClient instance, via one of the methods corresponding to the specific HTTP methods, or the generic org.vertx.scala.core.http.HttpClient.request method.
Once a request has been obtained, headers can be set on it, and data can be written to its body if required. Once you are ready to send the request, the
end()
method should be called.Nothing is actually sent until the request has been internally assigned an HTTP connection. The org.vertx.scala.core.http.HttpClient instance will return an instance of this class immediately, even if there are no HTTP connections available in the pool. Any requests sent before a connection is assigned will be queued internally and actually sent when an HTTP connection becomes available from the pool.
The headers of the request are actually sent either when the
end()
method is called, or, when the first part of the body is written, whichever occurs first.This class supports both chunked and non-chunked HTTP.
It implements org.vertx.java.core.streams.WriteStream so it can be used with org.vertx.java.core.streams.Pump to pump data with flow control.
An example of using this class is as follows:
Instances of HttpClientRequest are not thread-safe.