dphiffer / wp-json-api

WordPress JSON API
http://wordpress.org/extend/plugins/json-api/
258 stars 181 forks source link

Correct headers update #11

Closed andrewshatnyy closed 2 years ago

andrewshatnyy commented 11 years ago

I've added some functionality to error method in API.php and output, response in response.php This might look ugly but the Idea is to have certain headers to be served when wrong syntax used in queries or authentication has failed.

Currently there's only 200 which is pretty annoying when working with backbone.js

Please feel free to criticize my code I am new to PHP and will fix it accordingly.

Proposed code is working at http://nuwaxrecords.com/api/ 400 http://www.nuwaxrecords.com/api/get_nonce/

andrewshatnyy commented 11 years ago

Any updates on this Pull?

notslang commented 11 years ago

+1

wrozwad commented 10 years ago

+1 but add also $header=200 to respond and custom header when dev=1 (line 67). It's just to much work to have own pull request :P

andrewshatnyy commented 2 years ago

Closing this as it's been to long lol