Tag Info

New answers tagged

0

Where we should put search action? In GET /search/:text. This will return a JSON array containing the matches, every match containing the album it belongs to. This makes sense, because the client may be interested not in the track itself, but the entire album (imagine that you are searching for a song which, you believe, was in the same album as the one ...


1

I think in any language/framework/application it is good to try to have single responsibility of components, for your case it would mean to have each of the ajax "events" in separate files. you could have files like: /ajax/posts.php /ajax/userInfo.php ... each file could then require some core/common functionality from one location it makes it much more ...


2

Error handling of an API is exactly the same as error handling of any web application. Exceptions should be logged to a central syslog server, and the central log should be reviewed on regular basis. If you use a framework, the framework should handle this for you. Sending e-mails through PHP every time an exception occurs is a risky path. What if ...


2

What I would do: Contact the 3rd party site, and ask if they could include you in their CORS policy, if not then Make sure there's no JSONP or similar "public access" point to use, if not then Use a CORS proxy (There's quite a few out there: https://www.google.dk/search?q=free+cors+proxy&oq=free+cor - But do know that you now trust the CORS provider ...


0

Fundamentally, you can't take advantage of someone else's AJAX services unless they explicitly give you permission. There may be all sorts of sensitive information that could be exposed as a result. My browser protects me from this by enforcing cross-origin policies. Of course, I could defeat this by modifying my browser to ignore cross-origin concerns. ...



Top 50 recent answers are included