Re:Modern Web Application Architecture
by bobbyi on Saturday November 05, 2011 @04:04PM
(#3200757)
He talks about wanting to charge for the API. If the javascript on your public website directly calls your (otherwise paid) API, how can you avoid exposing the credentials it uses which are unmetered?
[ Parent
| on HN ]
I recall some functionality in a PHP framework I was using that allowed you to make API calls on the server side through use of a class or function. It was something like
$user = $api->GET('/accounts/the_user');
which would process the API call without actually making a separate HTTP request. Would this accomplish it?
Re:Modern Web Application Architecture
by Vandy_Travis on Saturday November 05, 2011 @05:22PM
(#3200950)
You could make sure that the requesting page is on your domain.
Re:Modern Web Application Architecture
by jonprins on Saturday November 05, 2011 @06:33PM
(#3201128)
It's trivial to use a proxy to modify the referral headers.
Re:Modern Web Application Architecture
by k7n4n5t3w4rt on Sunday November 06, 2011 @01:31AM
(#3201948)
Make the calls to the API over HTTPS.