Questions tagged [restler]

A micro framework that can expose any PHP class and its methods as Pragmatic and/or RESTful API.

Restler is a simple multi-format Web API Server written in PHP. It is open sourced under LGPL license.

258 questions
0
votes
1 answer

Capturing all inputs in a JSON request (using Restler)

I have a request where most of the input parameters are put in as a JSON request object. For documentation purposes, I want to specify the most common fields that a user can put in but there is a lot of variability to the name values that would go…
ken
  • 8,763
  • 11
  • 72
  • 133
0
votes
0 answers

Rewrites and Restler

I am struggling with a rewrite issue with Luracast Restler and Restler's API Explorer (a fork of Swagger UI). I have a fully working development environment running off of localhost of an OSX machine but the same files (including the .htaccess file)…
ken
  • 8,763
  • 11
  • 72
  • 133
0
votes
1 answer

REST request doesn't work outside of Explorer

I'm using Restler's API Explorer (a fork of Swagger UI) and when I test a service call there it works fine but when I cut and paste the same URL into Chrome's Advanced REST Client I get a "403 Forbidden" error. How can that be? Is there some sort…
ken
  • 8,763
  • 11
  • 72
  • 133
0
votes
0 answers

Providing REST services in Wordpress

I have an application that is built around Wordpress. It is fairly bespoke but none-the-less I still leverage and appreciate a lot of what comes with Wordpress too. Now what I'm trying to do is provide a RESTful API that will work off of the…
ken
  • 8,763
  • 11
  • 72
  • 133
0
votes
1 answer

Lack of response and typing info in API Explorer

I am using the latest version of Restler v3 (commit 0d79cd8) but I'm having some problems having my Swagger-based UI look the same as in the examples. The two problems I'm noticing are that variable typing and @return objects are not being…
ken
  • 8,763
  • 11
  • 72
  • 133
0
votes
4 answers

Can't find resources.json

For some reason when I deploy my API using Restler's API Explorer (a fork of Swagger UI) to production it gives me a general 404 error when I load: /api/explorer When I am more explicit and state: /api/explorer/index.html It loads the framing for…
ken
  • 8,763
  • 11
  • 72
  • 133
0
votes
1 answer

Crossdomain AJAX call to Luracast Restler API: "PUT" and "DELETE" sending "OPTIONS" - Why?

I've installed Luracast's Restler API framework and am having marvelous success with it all except when sending PUT or DELETE across domains. The below works fine when all on the same server, but when I cross domains, Firebug shows the the PUT or…
GDP
  • 8,109
  • 6
  • 45
  • 82
0
votes
1 answer

Restler php returning 404 for all results

I've been looking into implementing a REST implementation for my API and came across Restler. I've installed Restler 2.0 and am using Apache and php > 5.3. My class is below: Class Sample { function gettest() { return "This is a…
Ross
  • 1,639
  • 1
  • 18
  • 22
0
votes
1 answer

What is the best way to integrate a CakePHP app with a third party API framework?

On the same server I have a Restler 3.0 API server and also a CakePHP 2.3 application, I want to be able to use CakePHP controller functions from the Restler app. Of course I don't want CakePHP to do any rendering, just to deal with the data. I…
user698883
  • 55
  • 1
  • 4
0
votes
2 answers

PHP Restler support api URLs that are contained in other URLs

.. Couldn't think of a descriptive enough title. What I'm asking for is how do I do this? I want the following 2 API calls GET /api/users/2/duels - returns all of the duels for user 2 GET /api/users/2 - returns the profile for user 2 Since PHP…
JP.
  • 544
  • 5
  • 20
0
votes
1 answer

Restler always showing NOT FOUND on server, but not on local machine

When I go to http://localhost/api/auth/login I get what I expect.. some data that lets me log in. However, when I go to http://myurl.com/api/auth/login I just get { "error": { "code": 404, "message": "Not Found" …
JP.
  • 544
  • 5
  • 20
0
votes
1 answer

How can I return a data object when throwing a RestException?

function put($id, $name) { try { product::put($id, $name); } catch(\util\BadNameException $e) { throw new RestException(400, "Please supply a better name."); } } When returning the error message I also want to…
Christoffer
  • 514
  • 1
  • 5
  • 17
0
votes
1 answer

creating password protect web service with restler

I've successfully developed web service using restler framework. I can see those methods are accessible if I visit the URL. But if someone know that URL he can access my data, so my question comes here- How do I add username/password protected web…
Daric
  • 16,229
  • 11
  • 41
  • 58
0
votes
1 answer

How to Name a RESTLER json Result

Forgive my terminology im a newbie in in web dev. To visualize my question, see below. This is how RESTLER displays json: [ { "id": 1, "name": "Daniel Craig", "email": "dc@gmail.com" }, { "id": 2, "name": "Tom Cruise", "email":…
Reyboy
  • 9
0
votes
1 answer

Caching dynamic REST content in Cherokee

I'm developing a backend server for a mobile app using Cherokee + PHP-FPM + MySQL. I'm providing a RESTful API using Luracast Restler 2. How do you cache dynamic content so that, for example, once a client has requested a list of items through the…
Fabio Cionini
  • 767
  • 6
  • 15