Index

A B C D E F G H I J L M O P Q R S T U V W 
All Classes and Interfaces|All Packages|Serialized Form

A

addField(String, Object) - Method in class io.mochaapi.client.multipart.MultipartRequest
Adds a form field with an object value (converted to string).
addField(String, String) - Method in class io.mochaapi.client.multipart.MultipartRequest
Adds a form field to the multipart request.
addFile(String, File) - Method in class io.mochaapi.client.multipart.MultipartRequest
Adds a file to the multipart request.
addFile(String, File, String) - Method in class io.mochaapi.client.multipart.MultipartRequest
Adds a file to the multipart request with a custom filename.
addFile(String, Path) - Method in class io.mochaapi.client.multipart.MultipartRequest
Adds a file from a Path to the multipart request.
addHeaders(Map<String, String>) - Static method in interface io.mochaapi.client.RequestInterceptor
Creates a header interceptor that adds custom headers to all requests.
addRequestInterceptor(RequestInterceptor) - Method in class io.mochaapi.client.ApiClient.Builder
Adds a request interceptor.
addResponseInterceptor(ResponseInterceptor) - Method in class io.mochaapi.client.ApiClient.Builder
Adds a response interceptor.
allowLocalhost(boolean) - Method in class io.mochaapi.client.ApiClient.Builder
Allows localhost URLs (useful for development).
Api - Class in io.mochaapi.client
Main entry point for HTTP API requests.
Api() - Constructor for class io.mochaapi.client.Api
 
ApiClient - Class in io.mochaapi.client
Main client for making HTTP API requests with advanced configuration.
ApiClient.Builder - Class in io.mochaapi.client
Builder class for creating configured ApiClient instances.
ApiException - Exception Class in io.mochaapi.client.exception
Base exception for API-related errors.
ApiException(String) - Constructor for exception class io.mochaapi.client.exception.ApiException
Creates a new ApiException with the specified message.
ApiException(String, Throwable) - Constructor for exception class io.mochaapi.client.exception.ApiException
Creates a new ApiException with the specified message and cause.
ApiRequest - Class in io.mochaapi.client
Represents a configurable HTTP request with chainable methods.
ApiRequest(String, String) - Constructor for class io.mochaapi.client.ApiRequest
Creates a new API request with the specified URL and HTTP method.
ApiRequest(String, String, ApiClient) - Constructor for class io.mochaapi.client.ApiRequest
Creates a new API request with the specified URL and HTTP method.
ApiResponse - Class in io.mochaapi.client
Represents the response from an HTTP API request.
ApiResponse(int, String, Map<String, String>, JsonMapper) - Constructor for class io.mochaapi.client.ApiResponse
Creates a new API response with the specified data.
async(Consumer<ApiResponse>) - Method in class io.mochaapi.client.ApiRequest
Executes the request asynchronously with a callback.
available() - Method in class io.mochaapi.client.ManagedInputStream
 

B

BasicRetry - Class in io.mochaapi.client
Simple retry configuration for failed requests.
BasicRetry(int, Duration) - Constructor for class io.mochaapi.client.BasicRetry
Creates a new BasicRetry configuration.
bearerAuth(Supplier<String>) - Static method in interface io.mochaapi.client.RequestInterceptor
Creates an authentication interceptor that adds a Bearer token to requests.
body() - Method in class io.mochaapi.client.ApiResponse
Returns the response body as a string.
body(Object) - Method in class io.mochaapi.client.ApiRequest
Sets the request body.
build() - Method in class io.mochaapi.client.ApiClient.Builder
Builds the configured ApiClient.
build(MultipartRequest) - Static method in class io.mochaapi.client.multipart.MultipartBodyBuilder
Builds a multipart body from a MultipartRequest.
Builder() - Constructor for class io.mochaapi.client.ApiClient.Builder
 

C

close() - Method in class io.mochaapi.client.ManagedInputStream
 
code() - Method in class io.mochaapi.client.ApiResponse
Returns the HTTP status code.
connectTimeout(Duration) - Method in class io.mochaapi.client.ApiClient.Builder
Sets the connection timeout.
conservative() - Static method in class io.mochaapi.client.BasicRetry
Creates a BasicRetry with 2 attempts and 2-second delay.

D

DefaultHttpClientEngine - Class in io.mochaapi.client.internal
Default implementation of HttpClientEngine using Java 11+ HttpClient.
DefaultHttpClientEngine() - Constructor for class io.mochaapi.client.internal.DefaultHttpClientEngine
Creates a new DefaultHttpClientEngine with default configuration.
DefaultHttpClientEngine(HttpClient, JsonMapper) - Constructor for class io.mochaapi.client.internal.DefaultHttpClientEngine
Creates a new DefaultHttpClientEngine with custom HttpClient and JsonMapper.
DefaultHttpClientEngine(Duration, Duration, Duration) - Constructor for class io.mochaapi.client.internal.DefaultHttpClientEngine
Creates a new DefaultHttpClientEngine with custom timeout configuration.
delete(String) - Static method in class io.mochaapi.client.Api
Creates a DELETE request to the specified URL.
delete(String) - Method in class io.mochaapi.client.ApiClient
Creates a DELETE request to the specified URL.
download(File) - Method in class io.mochaapi.client.ApiRequest
Downloads the response to a file.
download(String) - Method in class io.mochaapi.client.ApiRequest
Downloads the response to a file with the specified filename.
download(Path) - Method in class io.mochaapi.client.ApiRequest
Downloads the response to a file path.
downloadStream() - Method in class io.mochaapi.client.ApiRequest
Downloads the response as a ManagedInputStream for streaming.

E

enableLogging() - Method in class io.mochaapi.client.ApiClient.Builder
Enables logging for requests and responses.
enableRetry() - Method in class io.mochaapi.client.ApiClient.Builder
Enables basic retry with standard configuration (3 attempts, 1-second delay).
enableRetry(int, Duration) - Method in class io.mochaapi.client.ApiClient.Builder
Enables basic retry with custom attempts and delay.
engine(HttpClientEngine) - Method in class io.mochaapi.client.ApiClient.Builder
Sets a custom HTTP client engine.
execute() - Method in class io.mochaapi.client.ApiRequest
Executes the request synchronously and returns the response.
execute(ApiRequest) - Static method in class io.mochaapi.client.Api
Executes a request synchronously and returns the response.
execute(ApiRequest) - Method in class io.mochaapi.client.ApiClient
Executes a request synchronously and returns the response.
execute(ApiRequest) - Method in interface io.mochaapi.client.HttpClientEngine
Executes an HTTP request and returns the response.
execute(ApiRequest) - Method in class io.mochaapi.client.internal.DefaultHttpClientEngine
 
executeAsync() - Method in class io.mochaapi.client.ApiRequest
Executes the request asynchronously and returns a CompletableFuture.
executeAsync(ApiRequest) - Static method in class io.mochaapi.client.Api
Executes a request asynchronously and returns a CompletableFuture.
executeAsync(ApiRequest) - Method in class io.mochaapi.client.ApiClient
Executes a request asynchronously and returns a CompletableFuture.
executeAsync(ApiRequest, Consumer<ApiResponse>) - Static method in class io.mochaapi.client.Api
Executes a request asynchronously with a callback.
executeAsync(ApiRequest, Consumer<ApiResponse>) - Method in class io.mochaapi.client.ApiClient
Executes a request asynchronously with a callback.
executeAsync(ApiRequest, Consumer<ApiResponse>, Consumer<Throwable>) - Static method in class io.mochaapi.client.Api
Executes a request asynchronously with both success and error callbacks.
executor(Executor) - Method in class io.mochaapi.client.ApiClient.Builder
Sets a custom executor for async operations.

F

fast() - Static method in class io.mochaapi.client.BasicRetry
Creates a BasicRetry with 5 attempts and 500ms delay.
forDevelopment() - Static method in class io.mochaapi.client.config.SecurityConfig
Creates a SecurityConfig suitable for development/testing.
forProduction() - Static method in class io.mochaapi.client.config.SecurityConfig
Creates a SecurityConfig suitable for production use.

G

get(String) - Static method in class io.mochaapi.client.Api
Creates a GET request to the specified URL.
get(String) - Method in class io.mochaapi.client.ApiClient
Creates a GET request to the specified URL.
getBaseRequest() - Method in class io.mochaapi.client.multipart.MultipartRequest
Returns the base ApiRequest.
getBody() - Method in class io.mochaapi.client.ApiRequest
 
getContent() - Method in class io.mochaapi.client.multipart.MultipartBodyBuilder.MultipartBody
Returns the multipart body content.
getContent() - Method in class io.mochaapi.client.multipart.MultipartRequest.FilePart
Reads the file content as bytes.
getContentLength() - Method in class io.mochaapi.client.multipart.MultipartBodyBuilder.MultipartBody
Returns the content length.
getContentType() - Method in class io.mochaapi.client.multipart.MultipartBodyBuilder.MultipartBody
Returns the content type header.
getContentType() - Method in class io.mochaapi.client.multipart.MultipartRequest.FilePart
Returns the content type.
getDelay() - Method in class io.mochaapi.client.BasicRetry
Returns the delay between retry attempts.
getFieldName() - Method in class io.mochaapi.client.multipart.MultipartRequest.FilePart
Returns the form field name.
getFields() - Method in class io.mochaapi.client.multipart.MultipartRequest
Returns the form fields in this multipart request.
getFile() - Method in class io.mochaapi.client.multipart.MultipartRequest.FilePart
Returns the file.
getFilename() - Method in class io.mochaapi.client.multipart.MultipartRequest.FilePart
Returns the filename.
getFiles() - Method in class io.mochaapi.client.multipart.MultipartRequest
Returns the files in this multipart request.
getHeaders() - Method in class io.mochaapi.client.ApiRequest
 
getMaxAttempts() - Method in class io.mochaapi.client.BasicRetry
Returns the maximum number of attempts.
getMethod() - Method in class io.mochaapi.client.ApiRequest
 
getQueryParams() - Method in class io.mochaapi.client.ApiRequest
 
getSecurityConfig() - Method in class io.mochaapi.client.ApiClient
Gets the security configuration for this client.
getSecurityConfig() - Method in class io.mochaapi.client.ApiRequest
Gets the security configuration from the associated client.
getSize() - Method in class io.mochaapi.client.multipart.MultipartRequest.FilePart
Returns the file size in bytes.
getStatusDescription() - Method in class io.mochaapi.client.ApiResponse
Gets a human-readable description of the status code.
getTotalFileSize() - Method in class io.mochaapi.client.multipart.MultipartRequest
Returns the total size of all files in bytes.
getUrl() - Method in class io.mochaapi.client.ApiRequest
 

H

hasFields() - Method in class io.mochaapi.client.multipart.MultipartRequest
Checks if this multipart request has any form fields.
hasFiles() - Method in class io.mochaapi.client.multipart.MultipartRequest
Checks if this multipart request has any files.
header(String, String) - Method in class io.mochaapi.client.ApiRequest
Adds a header to the request.
headers() - Method in class io.mochaapi.client.ApiResponse
Returns the response headers.
HttpClientEngine - Interface in io.mochaapi.client
Interface for executing HTTP requests.

I

intercept(ApiRequest) - Method in interface io.mochaapi.client.RequestInterceptor
Intercepts and optionally modifies a request before it is sent.
intercept(ApiResponse) - Method in interface io.mochaapi.client.ResponseInterceptor
Intercepts and optionally modifies a response after it is received.
io.mochaapi.client - package io.mochaapi.client
 
io.mochaapi.client.config - package io.mochaapi.client.config
 
io.mochaapi.client.exception - package io.mochaapi.client.exception
 
io.mochaapi.client.internal - package io.mochaapi.client.internal
 
io.mochaapi.client.multipart - package io.mochaapi.client.multipart
 
isAllowLocalhost() - Method in class io.mochaapi.client.config.SecurityConfig
Returns whether localhost URLs are allowed.
isBadGateway() - Method in class io.mochaapi.client.ApiResponse
Checks if the response status code is 502 (Bad Gateway).
isBadRequest() - Method in class io.mochaapi.client.ApiResponse
Checks if the response status code is 400 (Bad Request).
isClientError() - Method in class io.mochaapi.client.ApiResponse
Checks if the response indicates a client error (status code 400-499).
isClosed() - Method in class io.mochaapi.client.ManagedInputStream
Returns true if this stream has been closed.
isCreated() - Method in class io.mochaapi.client.ApiResponse
Checks if the response status code is 201 (Created).
isError() - Method in class io.mochaapi.client.ApiResponse
Checks if the response indicates an error (status code 400+).
isForbidden() - Method in class io.mochaapi.client.ApiResponse
Checks if the response status code is 403 (Forbidden).
isGatewayTimeout() - Method in class io.mochaapi.client.ApiResponse
Checks if the response status code is 504 (Gateway Timeout).
isInformational() - Method in class io.mochaapi.client.ApiResponse
Checks if the response indicates an informational response (status code 100-199).
isInternalServerError() - Method in class io.mochaapi.client.ApiResponse
Checks if the response status code is 500 (Internal Server Error).
isMultipart() - Method in class io.mochaapi.client.ApiRequest
 
isNoContent() - Method in class io.mochaapi.client.ApiResponse
Checks if the response status code is 204 (No Content).
isNotFound() - Method in class io.mochaapi.client.ApiResponse
Checks if the response status code is 404 (Not Found).
isOk() - Method in class io.mochaapi.client.ApiResponse
Checks if the response status code is 200 (OK).
isRedirect() - Method in class io.mochaapi.client.ApiResponse
Checks if the response indicates a redirect (status code 300-399).
isServerError() - Method in class io.mochaapi.client.ApiResponse
Checks if the response indicates a server error (status code 500-599).
isServiceUnavailable() - Method in class io.mochaapi.client.ApiResponse
Checks if the response status code is 503 (Service Unavailable).
isSuccess() - Method in class io.mochaapi.client.ApiResponse
Checks if the response indicates success (status code 200-299).
isTooManyRequests() - Method in class io.mochaapi.client.ApiResponse
Checks if the response status code is 429 (Too Many Requests).
isUnauthorized() - Method in class io.mochaapi.client.ApiResponse
Checks if the response status code is 401 (Unauthorized).
isUnprocessableEntity() - Method in class io.mochaapi.client.ApiResponse
Checks if the response status code is 422 (Unprocessable Entity).
isUrlSafe(String, SecurityConfig) - Static method in class io.mochaapi.client.internal.Utils
Checks if a URL is safe for HTTP requests.

J

JacksonJsonMapper - Class in io.mochaapi.client
Jackson-based implementation of JsonMapper.
JacksonJsonMapper() - Constructor for class io.mochaapi.client.JacksonJsonMapper
Creates a new JacksonJsonMapper with secure default configuration.
JacksonJsonMapper(ObjectMapper) - Constructor for class io.mochaapi.client.JacksonJsonMapper
Creates a new JacksonJsonMapper with a custom ObjectMapper.
json() - Method in class io.mochaapi.client.ApiResponse
Returns a JSON mapper for parsing the response body.
JsonException - Exception Class in io.mochaapi.client.exception
Exception thrown when JSON serialization or deserialization fails.
JsonException(String) - Constructor for exception class io.mochaapi.client.exception.JsonException
Creates a new JsonException with the specified message.
JsonException(String, Throwable) - Constructor for exception class io.mochaapi.client.exception.JsonException
Creates a new JsonException with the specified message and cause.
JsonMapper - Interface in io.mochaapi.client
Interface for JSON serialization and deserialization.

L

logging(Consumer<String>) - Static method in interface io.mochaapi.client.RequestInterceptor
Creates a simple logging interceptor that logs request details.
logging(Consumer<String>) - Static method in interface io.mochaapi.client.ResponseInterceptor
Creates a simple logging interceptor that logs response details.

M

ManagedInputStream - Class in io.mochaapi.client
A managed InputStream wrapper that implements AutoCloseable for proper resource management.
ManagedInputStream(byte[]) - Constructor for class io.mochaapi.client.ManagedInputStream
Creates a new ManagedInputStream wrapping the provided byte array.
mark(int) - Method in class io.mochaapi.client.ManagedInputStream
 
markSupported() - Method in class io.mochaapi.client.ManagedInputStream
 
multipart() - Method in class io.mochaapi.client.ApiRequest
Converts this request to a multipart request for file uploads.
MultipartBodyBuilder - Class in io.mochaapi.client.multipart
Builder for creating multipart/form-data request bodies.
MultipartBodyBuilder() - Constructor for class io.mochaapi.client.multipart.MultipartBodyBuilder
 
MultipartBodyBuilder.MultipartBody - Class in io.mochaapi.client.multipart
Represents a built multipart body with content and content type.
MultipartRequest - Class in io.mochaapi.client.multipart
Represents a multipart/form-data request for file uploads.
MultipartRequest.FilePart - Class in io.mochaapi.client.multipart
Represents a file part in a multipart request.

O

of(ApiRequest) - Static method in class io.mochaapi.client.multipart.MultipartRequest
Creates a new multipart request from an ApiRequest.

P

parse(String, Class<T>) - Method in class io.mochaapi.client.JacksonJsonMapper
 
parse(String, Class<T>) - Method in interface io.mochaapi.client.JsonMapper
Parses a JSON string to an object of the specified type.
parseUrl(String, SecurityConfig) - Static method in class io.mochaapi.client.internal.Utils
Safely parses a URL string into a URI object.
patch(String) - Static method in class io.mochaapi.client.Api
Creates a PATCH request to the specified URL.
patch(String) - Method in class io.mochaapi.client.ApiClient
Creates a PATCH request to the specified URL.
post(String) - Static method in class io.mochaapi.client.Api
Creates a POST request to the specified URL.
post(String) - Method in class io.mochaapi.client.ApiClient
Creates a POST request to the specified URL.
put(String) - Static method in class io.mochaapi.client.Api
Creates a PUT request to the specified URL.
put(String) - Method in class io.mochaapi.client.ApiClient
Creates a PUT request to the specified URL.

Q

query(String, Object) - Method in class io.mochaapi.client.ApiRequest
Adds a query parameter to the request.

R

read() - Method in class io.mochaapi.client.ManagedInputStream
 
read(byte[]) - Method in class io.mochaapi.client.ManagedInputStream
 
read(byte[], int, int) - Method in class io.mochaapi.client.ManagedInputStream
 
readTimeout(Duration) - Method in class io.mochaapi.client.ApiClient.Builder
Sets the read timeout.
RequestInterceptor - Interface in io.mochaapi.client
Interface for intercepting and modifying HTTP requests before they are sent.
reset() - Method in class io.mochaapi.client.ManagedInputStream
 
ResponseInterceptor - Interface in io.mochaapi.client
Interface for intercepting HTTP responses after they are received.
retry(BasicRetry) - Method in class io.mochaapi.client.ApiClient.Builder
Sets basic retry configuration.
retryOnStatus(int[], int) - Static method in interface io.mochaapi.client.ResponseInterceptor
Creates a retry interceptor that automatically retries on certain status codes.

S

SecurityConfig - Class in io.mochaapi.client.config
Simple security configuration for MochaJSON.
SecurityConfig() - Constructor for class io.mochaapi.client.config.SecurityConfig
Creates a new SecurityConfig with production-safe defaults (localhost blocked).
SecurityConfig(boolean) - Constructor for class io.mochaapi.client.config.SecurityConfig
Creates a new SecurityConfig with custom localhost setting.
shouldRetry(int) - Method in class io.mochaapi.client.BasicRetry
Determines if a request should be retried based on the attempt number.
size() - Method in class io.mochaapi.client.ManagedInputStream
Returns the number of bytes that can be read from this stream.
skip(long) - Method in class io.mochaapi.client.ManagedInputStream
 
standard() - Static method in class io.mochaapi.client.BasicRetry
Creates a BasicRetry with 3 attempts and 1-second delay.
stringify(Object) - Method in class io.mochaapi.client.JacksonJsonMapper
 
stringify(Object) - Method in interface io.mochaapi.client.JsonMapper
Converts an object to a JSON string.

T

throwOnError() - Static method in interface io.mochaapi.client.ResponseInterceptor
Creates an error handling interceptor that throws exceptions for error status codes.
to(Class<T>) - Method in class io.mochaapi.client.ApiResponse
Converts the response body to the specified type.
toList() - Method in class io.mochaapi.client.ApiResponse
Converts the response body to a List.
toList(String) - Method in class io.mochaapi.client.JacksonJsonMapper
 
toList(String) - Method in interface io.mochaapi.client.JsonMapper
Parses a JSON string to a List.
toMap() - Method in class io.mochaapi.client.ApiResponse
Converts the response body to a Map.
toMap(String) - Method in class io.mochaapi.client.JacksonJsonMapper
 
toMap(String) - Method in interface io.mochaapi.client.JsonMapper
Parses a JSON string to a Map.
toString() - Method in class io.mochaapi.client.BasicRetry
 
toString() - Method in class io.mochaapi.client.config.SecurityConfig
 
toString() - Method in class io.mochaapi.client.multipart.MultipartRequest.FilePart
 
toString() - Method in class io.mochaapi.client.multipart.MultipartRequest
 

U

Utils - Class in io.mochaapi.client.internal
Utility class for URL validation and security checks.
Utils() - Constructor for class io.mochaapi.client.internal.Utils
 

V

validateUrl(String, SecurityConfig) - Static method in class io.mochaapi.client.internal.Utils
Validates a URL for security and format correctness.

W

writeTimeout(Duration) - Method in class io.mochaapi.client.ApiClient.Builder
Sets the write timeout.
A B C D E F G H I J L M O P Q R S T U V W 
All Classes and Interfaces|All Packages|Serialized Form