Comments (8)
Hi,
Same problem here...but no solution
Nicolas
from wp-api.
Using Basic authentication (--user user:pass
) should work, at least until #37 is completed.
Could this be related to #8? Are you running PHP in CGI mode?
from wp-api.
Thanks for your reply.
- Completely #8, if I test in a php file on the root, the server variables $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'] are correct, but these variables are empty in WP-API/lib/class-wp-json-posts.php file.
- Yes I use CGI/FastCGI on my server, this is the problem?
In #37, I don't understand:
"Basic authentication can be removed and/or moved to a separate plugin to help development"
Removed or moved? and where is this plugin if moved.
We must not use Basic authentification, only Oauth, that it?
Otherwise : in official documentation ( https://github.com/WP-API/WP-API/blob/master/docs/guides/getting-started.md)
In my bash command line, curl have not --data-binary option also -d or --data and use like this:
curl -d "@updated-post.json"
Have a nice day.
from wp-api.
Yes,
I do have CGI support switched on. No idea what it is or if I should turn it off. Any advice with regards to this would be helpful. Though I run PHP support as the Apache Module. Does that make sense?
Copy and paste from my setup:
- PHP support (Run PHP as APACHE , PHP version 5.4.21 )
Note that switching the PHP handler type may break functionality of existing PHP scripts on this website.
Learn how to choose the most suitable PHP settings - CGI support (cgi-bin directory is located in the root directory of webspace ) is enabled
S
from wp-api.
I have installed this plugin:
WP BASIC Auth
And the basic auth is not dropped now and curl command work fine ;)
Why this information isn't in documentation?
Thanks.
from wp-api.
Hello Boyquotes,
ok, my curl works now! Thank you for that hint with the plugin! Now I only would like to it working with the JS code. Basically how can I write this:
curl --data '{"title": "Hello Updated World!"}'
-H "Content-Type: application/javascript"
--user username:password
http://apitest.landwire.net/wordpress/wp-json.php/posts/1
Instead in Javascript? I tried the code above in my initial question, but I must be doing something wrong I assume. Maybe some syntax? Any help is highly appreciated!
from wp-api.
Closing as duplicate of #8.
Not sure what else we can do here, but thanks for the heads up that there's a plugin that fixes this for you. We'll look into implementing their workaround into WP-API :)
from wp-api.
hi, i still get 400 bad request using AJAX. I already installed WP Basic Auth. Any suggestion? Thanks
from wp-api.
Related Issues (20)
- urldecode for slug HOT 1
- Can i extract in JSON FORMAT for mobile app? HOT 2
- 2u8mqg HOT 1
- Output rendering problem HOT 1
- Make a new query with a specific link HOT 1
- register_rest_field update_callback not work HOT 1
- Unable to post users HOT 1
- How to access superagent's request obj? HOT 2
- Get URL/File of an embedded video HOT 1
- Wordpress-Api HOT 1
- Custom fields and query in url HOT 1
- pass utf-8 characters to url HOT 1
- Rest Api Visual Composer HOT 1
- Want display all parent categories with first level child HOT 1
- want to display all parent category with first level child HOT 1
- unable to get url parameters HOT 1
- /wp-json/wp/v2/posts and /wp-json/wp/v2/posts doesen't work. HOT 1
- Error on UTF8 encode HOT 1
- Error on UTF8 encode HOT 1
- Custom post type filter parent_post not working in wp rest api HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wp-api.