You’re setting the Content-Type
header to application/json
and wp_remote_post()
doesn’t intelligently JSON-encode the request data (the body
array), so you should manually do it. So for example:
'body' => json_encode( array(
'Username' => 'myusername',
'Password' => 'mypassword'
) )
Related Posts:
- How do I cache (core) API requests?
- WP REST API only returning partial list of users
- Retrieving pages with multiple tags using REST API
- How do I use the WP REST API plugin and the OAuth Server plugin to allow for registration and login?
- WP API : date_query parameter
- Get more than 10 posts in a specific category with the wordpress api
- Authentication for a mobile app connected via wp-rest api?
- Stuck with wp_remote_post sending data to an external api on user registration
- Create post with REST API in php with file_get_contents
- API getting null values with wp_remote_post
- node-wpapi: how to handle authentication?
- Get non-rendered content from WP-API
- Authenticating a user with the WP-API V2 in Postman
- How to edit feature image with XML RPC?
- WP REST API and Access-Control-Allow-Origin
- Post content in wp_remote_post
- Limit the number of external API calls per second
- How to use following API with WordPress?
- Extending the API I created to return category names
- XMLRPC: How to retrieve possible custom fields for a new post?
- This page didn’t load Google Maps correctly. See the JavaScript console for technical details
- This page didn’t load Google Maps correctly. See the JavaScript console for technical details
- Constructing requests with URL Query String in Python
- Postman Resolving “Invalid CORS request” for a POST Request
- WordPress Rest API custom endpoint optional param
- WP function/filter for modifying http headers?
- WP-API v2 Custom Endpoint Response Formatting
- Set up WP Authentication from External API
- Slow REST API calls on self-hosted WordPress [closed]
- WordPress JSON output
- how to authenticate for the REST API from a plugin and from command line
- External WordPress API
- WordPress API – Get Drafts
- How to stop WP API endpoint from caching?
- How to implement ERP (Enterprise Resource Planning) into WordPress?
- Gutenberg internal page link search box
- Sync posts from one WordPress site to another
- Passing variables to new page
- Developing Themes with React/Angular
- WordPress API – count posts
- API in numbers?
- Does WordPress support a shortcode calling itself from within a shortcode call?
- API for Post Stats for Self-Hosted WordPress using JetPack [closed]
- How to get WordPress Plugins Data in PHP using Plugin API?
- Displaying Content with WP Rest API
- How to integrate Yelp API
- Where to find WordPress API changes for each version released
- Custom Post for Locating by Google Maps API
- Get all tags not just first 10 with wp api 2.0
- How can I cache WordPress Rest API Response
- WordPress REST API always misses parameters – rest_missing_callback_param
- Unable to find API Key for my blog
- How to add WP API and JS featured image attachment
- Why aren’t tags and categories added in post request to WP Rest API
- get_option() fails to return binary result
- Integrate ZOHO Recruit API?
- Allow logged in WordPress user to access 3rd party Laravel API via OAuth
- WC REST Payment – Stripe Gateway’ is not available
- PHP to Handle API Return instead of print
- How do I query my WordPress posts on another HTML page using the WordPress Restful API?
- Theme Customizer API Live Preview
- How to query WordPress from another application?
- Integrate product feed API in Woocommerce [closed]
- WordPress keeps autoplaying my Youtube-Links no matter what I write
- How to fix AWS SNS API end point code that cause site not to load?
- Integrating API in to WordPress
- Soundcloud Smart Player
- Jetpack JSON API configure button not showing [closed]
- New Twitter API and Twitter count + timeline doesn’t work anymore [closed]
- wp_signon returns user but the user is not logged in because wp installed on subdomain. How to make it work?
- get_pages and get_posts returning different data?
- Working Around rest_forbidden_context
- WordPress REST API – get custom taxonomy category posts
- How to queue API requests with PHP in WordPress?
- How to store API authentication password?
- WordPress and API (rapidapi) request
- I need some assistance opening a few videos in VLC on android automatically from my wordpress site
- Remove unwanted fields from WP API response
- WordPress API “code”:”rest_no_route” with Custom Route
- Get total count of records in WP GraphQL API
- Adding Amchart Interface to WordPress API
- Intergrate JSON into wordpress
- WordPress json rest api displaying 10 categories only
- Deleting media using the WordPress Rest API
- wp_remote_post To external API multiple values with the same key
- Creating posts, containing data from remote API
- Gravit Forms Notification send after 3rd party API response
- Hiding WordPress REST endpoints from public viewing using Basic Authentication
- Expand author, tags and categories in the WordPress JSON API
- How to display parent category with first level child in REST API
- Best way to make a JSON API from WordPress?
- Encrypt API key [duplicate]
- Can I get the post id when trying to make a new post using xmlrpc?
- basic wordpress api endpoint to serve a key-value dictionary
- Trying to integrate wordpress query on other website – getting redirection to wp-install
- How to login via wordpress api and get user details?
- Zoho subscription API to WordPress [closed]
- How many users/load can the rest API handle?
- How to update WordPress Plugins in your own maintance application?
- Using WordPress API to mass update posts freezes the server