### YamlMime:JavaType uid: "com.azure.core.http.HttpResponse" fullName: "com.azure.core.http.HttpResponse" name: "HttpResponse" nameWithType: "HttpResponse" summary: "Represents an incoming HTTP response." inheritances: - "" inheritedClassMethods: - classRef: "java.lang.Object" methodsRef: - "clone" - "equals" - "finalize" - "getClass" - "hashCode" - "notify" - "notifyAll" - "toString" - "wait" - "wait" - "wait" syntax: "public abstract class **HttpResponse**
implements Closeable" constructors: - uid: "com.azure.core.http.HttpResponse.HttpResponse(com.azure.core.http.HttpRequest)" fullName: "com.azure.core.http.HttpResponse.HttpResponse(HttpRequest request)" name: "HttpResponse(HttpRequest request)" nameWithType: "HttpResponse.HttpResponse(HttpRequest request)" summary: "Creates an instance of ." modifiers: - "protected" parameters: - description: "The that resulted in this ." name: "request" type: "" syntax: "protected HttpResponse(HttpRequest request)" desc: "Creates an instance of ." methods: - uid: "com.azure.core.http.HttpResponse.buffer()" fullName: "com.azure.core.http.HttpResponse.buffer()" name: "buffer()" nameWithType: "HttpResponse.buffer()" summary: "Gets a new object wrapping this response with its content buffered into memory." syntax: "public HttpResponse buffer()" desc: "Gets a new object wrapping this response with its content buffered into memory." returns: description: "A new with the content buffered." type: "" - uid: "com.azure.core.http.HttpResponse.close()" fullName: "com.azure.core.http.HttpResponse.close()" name: "close()" nameWithType: "HttpResponse.close()" summary: "Closes the response content stream, if any." syntax: "public void close()" desc: "Closes the response content stream, if any." - uid: "com.azure.core.http.HttpResponse.getBody()" fullName: "com.azure.core.http.HttpResponse.getBody()" name: "getBody()" nameWithType: "HttpResponse.getBody()" summary: "Get the publisher emitting response content chunks." modifiers: - "abstract" syntax: "public abstract Flux getBody()" desc: "Get the publisher emitting response content chunks.\n\nReturns a stream of the response's body content. Emissions may occur on Reactor threads which should not be blocked. Blocking should be avoided as much as possible/practical in reactive programming but if you do use methods like `block()` on the stream then be sure to use `publishOn` before the blocking call." returns: description: "The response's content as a stream of ." type: "Flux<ByteBuffer>" - uid: "com.azure.core.http.HttpResponse.getBodyAsBinaryData()" fullName: "com.azure.core.http.HttpResponse.getBodyAsBinaryData()" name: "getBodyAsBinaryData()" nameWithType: "HttpResponse.getBodyAsBinaryData()" summary: "Gets the that represents the body of the response." syntax: "public BinaryData getBodyAsBinaryData()" desc: "Gets the that represents the body of the response.\n\nSubclasses should override this method." returns: description: "The response body." type: "" - uid: "com.azure.core.http.HttpResponse.getBodyAsByteArray()" fullName: "com.azure.core.http.HttpResponse.getBodyAsByteArray()" name: "getBodyAsByteArray()" nameWithType: "HttpResponse.getBodyAsByteArray()" summary: "Gets the response content as a `byte[]`." modifiers: - "abstract" syntax: "public abstract Mono getBodyAsByteArray()" desc: "Gets the response content as a `byte[]`." returns: description: "The response content as a byte[]." type: "Mono<[]>" - uid: "com.azure.core.http.HttpResponse.getBodyAsInputStream()" fullName: "com.azure.core.http.HttpResponse.getBodyAsInputStream()" name: "getBodyAsInputStream()" nameWithType: "HttpResponse.getBodyAsInputStream()" summary: "Gets the response content as an ." syntax: "public Mono getBodyAsInputStream()" desc: "Gets the response content as an ." returns: description: "The response content as an ." type: "Mono<InputStream>" - uid: "com.azure.core.http.HttpResponse.getBodyAsString()" fullName: "com.azure.core.http.HttpResponse.getBodyAsString()" name: "getBodyAsString()" nameWithType: "HttpResponse.getBodyAsString()" summary: "Gets the response content as a ." modifiers: - "abstract" syntax: "public abstract Mono getBodyAsString()" desc: "Gets the response content as a .\n\nBy default, this method will inspect the response body for containing a byte order mark (BOM) to determine the encoding of the string (UTF-8, UTF-16, etc.). If a BOM isn't found this will default to using UTF-8 as the encoding, if a specific encoding is required use ." returns: description: "The response content as a ." type: "Mono<String>" - uid: "com.azure.core.http.HttpResponse.getBodyAsString(java.nio.charset.Charset)" fullName: "com.azure.core.http.HttpResponse.getBodyAsString(Charset charset)" name: "getBodyAsString(Charset charset)" nameWithType: "HttpResponse.getBodyAsString(Charset charset)" summary: "Gets the response content as a ." modifiers: - "abstract" parameters: - description: "The to use as the string encoding." name: "charset" type: "Charset" syntax: "public abstract Mono getBodyAsString(Charset charset)" desc: "Gets the response content as a ." returns: description: "The response content as a ." type: "Mono<String>" - uid: "com.azure.core.http.HttpResponse.getHeaderValue(com.azure.core.http.HttpHeaderName)" fullName: "com.azure.core.http.HttpResponse.getHeaderValue(HttpHeaderName headerName)" name: "getHeaderValue(HttpHeaderName headerName)" nameWithType: "HttpResponse.getHeaderValue(HttpHeaderName headerName)" summary: "Lookup a response header with the provider ." parameters: - description: "the name of the header to lookup." name: "headerName" type: "" syntax: "public String getHeaderValue(HttpHeaderName headerName)" desc: "Lookup a response header with the provider ." returns: description: "the value of the header, or null if the header doesn't exist in the response." type: "String" - uid: "com.azure.core.http.HttpResponse.getHeaderValue(java.lang.String)" fullName: "com.azure.core.http.HttpResponse.getHeaderValue(String name)" name: "getHeaderValue(String name)" nameWithType: "HttpResponse.getHeaderValue(String name)" summary: "Lookup a response header with the provided name." deprecatedTag: "Use as it provides better performance." modifiers: - "abstract" parameters: - description: "the name of the header to lookup." name: "name" type: "String" syntax: "@Deprecated
public abstract String getHeaderValue(String name)" desc: "Lookup a response header with the provided name." hasDeprecatedTag: true returns: description: "the value of the header, or null if the header doesn't exist in the response." type: "String" - uid: "com.azure.core.http.HttpResponse.getHeaders()" fullName: "com.azure.core.http.HttpResponse.getHeaders()" name: "getHeaders()" nameWithType: "HttpResponse.getHeaders()" summary: "Get all response headers." modifiers: - "abstract" syntax: "public abstract HttpHeaders getHeaders()" desc: "Get all response headers." returns: description: "the response headers" type: "" - uid: "com.azure.core.http.HttpResponse.getRequest()" fullName: "com.azure.core.http.HttpResponse.getRequest()" name: "getRequest()" nameWithType: "HttpResponse.getRequest()" summary: "Gets the which resulted in this response." modifiers: - "final" syntax: "public final HttpRequest getRequest()" desc: "Gets the which resulted in this response." returns: description: "The which resulted in this response." type: "" - uid: "com.azure.core.http.HttpResponse.getStatusCode()" fullName: "com.azure.core.http.HttpResponse.getStatusCode()" name: "getStatusCode()" nameWithType: "HttpResponse.getStatusCode()" summary: "Get the response status code." modifiers: - "abstract" syntax: "public abstract int getStatusCode()" desc: "Get the response status code." returns: description: "The response status code" type: "" - uid: "com.azure.core.http.HttpResponse.writeBodyTo(java.nio.channels.WritableByteChannel)" fullName: "com.azure.core.http.HttpResponse.writeBodyTo(WritableByteChannel channel)" name: "writeBodyTo(WritableByteChannel channel)" nameWithType: "HttpResponse.writeBodyTo(WritableByteChannel channel)" summary: "Transfers body bytes to the ." parameters: - description: "The destination ." name: "channel" type: "WritableByteChannel" syntax: "public void writeBodyTo(WritableByteChannel channel)" exceptions: - description: "When I/O operation fails." type: "IOException" desc: "Transfers body bytes to the ." - uid: "com.azure.core.http.HttpResponse.writeBodyToAsync(java.nio.channels.AsynchronousByteChannel)" fullName: "com.azure.core.http.HttpResponse.writeBodyToAsync(AsynchronousByteChannel channel)" name: "writeBodyToAsync(AsynchronousByteChannel channel)" nameWithType: "HttpResponse.writeBodyToAsync(AsynchronousByteChannel channel)" summary: "Transfers body bytes to the ." parameters: - description: "The destination ." name: "channel" type: "AsynchronousByteChannel" syntax: "public Mono writeBodyToAsync(AsynchronousByteChannel channel)" desc: "Transfers body bytes to the ." returns: description: "A that completes when transfer is completed." type: "Mono<Void>" type: "class" desc: "Represents an incoming HTTP response.\n\nThis class encapsulates an HTTP response, including the HTTP status code, headers, and body. It provides methods to get these properties.\n\nThis class is useful when you want to process an HTTP response received from a server. For example, you can use it to get the status code to check if the request was successful, get the headers to check for any additional information, and get the body to process the content of the response.\n\nNote: This class implements , so you should call the method when you're done with the HTTP response to free any resources associated with it." implements: - "Closeable" metadata: {} package: "com.azure.core.http" artifact: com.azure:azure-core:1.52.0