I’ve met the same issue.
…the recommended Basic Auth…
I found that the problem is in the Basic Auth plugin. WP-API guys recommend using their own plugin and this solution works for me.
- Deactivate all activated basic auth plugins in your WordPress dashboard
- On the machine your WordPress is running go to the plugin folder
-
Run
git clone https://github.com/WP-API/Basic-Auth.git
-
Go to your WordPress admin dashboard, plugins page. JSON Basic Authentication should be in the list. Activate it.
Now creating a record via POST request should work.
Related Posts:
- What WP-API authentication method should I use to interact with anonymous / not-logged visitors?
- Ajax for non-logged-in users
- Extending wp JavaScript base class to make a post request to a custom REST endpoint
- wp-admin AJAX with Fetch API is done without user
- How to add WP API and JS featured image attachment
- how to send Ajax request in wordpress backend
- Why a strange discrepency between get_current_user_id() when using AJAX versus output of document.cookie?
- SSO autologin WordPress + Ajax
- post values to custom post type which has advanced custom fields
- Should I edit a user meta field with PUT, PATCH, or POST and WP::Editable
- Usage of wp_send_json_success and wp_redirect at the same time
- How to submit a button automatically after every scheduled hours?
- Google Maps API throws “Uncaught ReferenceError: google is not defined” only when using AJAX
- Initialize TinyMCE editor / visual editor after AJAX insert
- Displaying PHP Errors from admin-ajax.php
- wp_set_auth_cookie() doesn’t work in Ajax call
- WP-AJAX vs WP REST API: What to use for requests to the website from outside?
- SSL breaks customizer: page isn’t returned from ajax
- Is it safe to assume that a nonce may be validated more than once?
- Fetching private posts or custom post types via WP-API with basic authentication
- Using Nonces for AJAX that only retrieves data
- WP set auth cookie using Ajax is not saved to browser
- How to implement AJAX post navigation into WordPress?
- wp_ajax_[service] returning 0
- Ajax function returns -1
- Quick Edit: Selected Custom Taxonomy Not Refreshing After Save
- Is it OK to use a system cron to trigger a function hooked into the AJAX API
- Filter WP user acf field by ajax
- wp_verify_nonce always returns false when logged in as admin
- fetching via fetch/ajax gutenberg block data from third party
- How to make ajax content indexable by search engines?
- Conditional action hooks
- WordPress function to get term or post object by id
- How to check username availability with ajax at registration
- Conditional success callback based on Ajax Response not working
- admin-ajax.php slow, how to speed it up?
- I’m getting a 401 while calling the wp-json endpoint via ajax
- Unable to parse JSON response from wp_send_json_success [closed]
- Keep getting 400 Bad Request error when trying out AJAX on custom theme
- problem with WordPress ajax
- Ajax simple experiment
- How to load new text widgets and polls into the sidebar without reloading the page?
- How to make tabulator ajax call in wordpress?
- Radio buttons live refresh in the customizer
- Admin ajax add tag callback
- Stop auto load wp-admin admin-ajax.php
- wp_enqueue_script() doesn’t work with AJAX
- Save & Reset button in theme-option with Ajax (without refresh)
- Ajax Request for both logged and non logged users
- Ajax Multi Response Problem
- AJAX call inside plugin class not triggering
- Custom AJAX Endpoint not returning any result
- Contact form 7 Hide response messages after 5 seconds
- WordPress Heartbeat API cannot parse data
- how should i get json encoded data from wordpress ajax action page
- Cache plugins and ajax nonce verification
- Ajax function on #publish only saves as draft – how to make it publish?
- AJAX call broken after actualization
- WP_Ajax Hook doesn’t execute this PHP code
- custom autocomplete search
- Ajax function not returning any results
- ajax problem – function on server is not called
- wp_mail doesn’t work when logged in?
- Need help with Access-Control-Allow-Origin
- Send email via ajax
- wp_ajax handler with multiple class instances
- admin-ajax.php (aborted) error when using jQuery.get
- Load page HTML content through AJAX
- problem using ajax url
- How to display contact form 7 form in vanilla js without jquery in frontend
- Error sending array data from php to javascript
- Sharing variables in both actions wp_footer and wp_ajax
- Display full WordPress post under search form using AJAX
- Ajax callback not work
- WordPress Select Option Load Custom Fields
- Search live Ajax
- jQuery.post returns 0
- Ajax login fails: script sets cookies, but is_user_logged_in() returns false
- Opening Modal popup on Ajax form submission
- Ajax sometimes work and sometimes just don’t work
- admin-ajax error 400
- wordpress admin ajax trash_comment
- Failed to load resource: the server responded with a status of 404 (Not Found) admin-ajax.php
- Javascript output now showing in custom widget
- Create a post with REST API and adding a category
- how to correctly use json_encode with ajax
- delete post meta data in array WordPress
- How to trigger lost password email using REST API?
- Display post thumbnail after clicking on post id with AJAX
- Retrieve Header Background Image with AJAX
- How to block search engines indexing certain AJAX actions
- wp_ajax_action, wp_ajax_nopriv_action not working
- Manually cache a special, non-WP-but-using-WP page (e.g. Ajax results) with W3TC
- Is it a good idea to init ajax functions only while ‘DOING_AJAX’
- register_setting and AJAX?
- Static var overwritten with WP AJAX action, works fine without AJAX
- ajax response is 0 instead of ‘script’ [duplicate]
- using ajax to query sql
- Front-end ajax problem all users and guests getting a 302 redirect when accessing wp-admin/admin-ajax.php
- Use Ajax to get an Options Settings Value