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?
- Trying to create and update wordpress from python library
- 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
- What is an Endpoint?
- Constructing requests with URL Query String in Python
- Yahoo! Finance CSV file will not return Dow Jones (^DJI)
- Is there a developers api for craigslist.org
- How do you get the API key for Locu?
- Postman Resolving “Invalid CORS request” for a POST Request
- WordPress Rest API custom endpoint optional param
- WP function/filter for modifying http headers?
- Access WordPress API Outside of WordPress (command-line PHP)
- Create API for single sign-on with 3rd party site
- Query WP REST API v2 by multiple meta keys
- WP-API v2 Custom Endpoint Response Formatting
- Set up WP Authentication from External API
- Is there a way to get protected meta fields through any of the available built-in WordPress APIs? (xmlrpc, wp-json)
- What is the best way to get directory path for wp-config.php?
- Slow REST API calls on self-hosted WordPress [closed]
- WordPress JSON output
- WordPress Rest API
- Send data to 3rd party api with wp_remote_post on wp_login
- how to authenticate for the REST API from a plugin and from command line
- External WordPress API
- WordPress API – Get Drafts
- Should I store external API data in my WP database or keep it as a transient?
- How to stop WP API endpoint from caching?
- Sending POST Request from server
- How to implement ERP (Enterprise Resource Planning) into WordPress?
- List Table API – Safe to use?
- API integration with WordPress
- How do I retrieve a list of popular plugins using the WordPress.org Plugin API?
- POST to a REST API from a wordpress form
- How to get the attached gallery in the rest API?
- Gutenberg internal page link search box
- get WP-API by page id
- WordPress.org Support Forum API
- Sync posts from one WordPress site to another
- Authentication/API Questions
- Custom route for WP-API gives “rest_no_route” value
- Connect external web app to wordpress
- How to get all posts (in chunks) via XML-RPC?
- How to add a custom parameter to a WP API default route?
- “rest_no_route” – Debug error
- Passing variables to new page
- utf8 encoding in json rest api
- Developing Themes with React/Angular
- curl POST work with user meta but not the custom user meta
- Implementing the wp json-rest api
- WordPress API – count posts
- How to Securely and remotely Create new user in wordpress using Rest API
- API in numbers?
- how to get nonce using json api
- Does WordPress support a shortcode calling itself from within a shortcode call?
- What is the official way to consume the WordPress API? (api.wordpress.org)
- API for Post Stats for Self-Hosted WordPress using JetPack [closed]
- How to get title tag of an external page with http api?
- How to Hit External REST POST API in WordPress? [closed]
- WordPress REST API “rest_authentication_errors” doesn’t work external queries?
- 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
- I am trying to use the Theme Customization API but I keep getting an error
- Custom Post for Locating by Google Maps API
- How to Increase WordPress JSON API Speed?
- Extending WordPress REST API
- WordPress JSON API Extend to Create Users [closed]
- External API to WP
- Headless WordPress – Issue with plugin path
- Can’t get POST data in API endpoint callback
- 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
- Possible to use wordpress as publishing platform but programmatically inject content?
- Unable to find API Key for my blog
- How to add WP API and JS featured image attachment
- Adding rest api endpoints to an old theme
- How to avoid loading wp-load.php from external php scripts?
- Develop REST API using WordPress for Android app [closed]