Skip to content

WP REST Client

Maven Central License Coverage Java Java


A modular Java client for interacting with the WordPress REST API.

Overview

WP REST Client provides a type-safe Java API for WordPress REST endpoints, with interchangeable HTTP client implementations.

The client uses the WordPress REST API discovery mechanism to automatically resolve the REST API root URL from the site base URL. Users typically only need to provide the WordPress site URL; the client discovers the API endpoint according to the WordPress REST API discovery specification.


Features

  • Type-safe Java API for WordPress REST resources
  • Pluggable HTTP client implementations
  • Apache HttpClient 5 support (Apache HttpClient 5.6)
  • OkHttp support (OkHttp)
  • WordPress REST API endpoint discovery
  • Basic Authentication support
  • JWT Authentication support
  • Integration-tested WordPress compatibility

Available Implementations

Implementation Artifact
Apache HttpClient 5 wp-rest-client-apache
OkHttp wp-rest-client-okhttp

Documentation

Start with the Installation page, then continue with Quick Start.

Useful references:


Javadoc