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

Restler3 RC4: oAuth doesn't work

Just updated my restler 3 to release candidate 4 to try oAuth2 implementation. I've a restler 3 server and client, the server should offer an oAuth2.0 server and the client should implement oAuth2.0. But the oAuth2.0 client example index.php page…
user1289915
0
votes
1 answer

unexpected recursion in restler call (node/js)

I want to get a URI, parse it, and then get another URI based on the parsed data. Using restler, I thought I could do the parsing and the second get call from the .on('complete',...) function of the first get call. It doesn't seem to work as I…
jbirkel
  • 27
  • 2
0
votes
1 answer

PHP Restler Server 500 Error

I've installed restler using composer. I've set up a virtual host for it. I'm able to go to my localhost in my browser and it shows some informational pages but as soon as I try one of the APIs I get a server 500 error. My PHP logs say: Function…
chrislondon
  • 12,487
  • 5
  • 26
  • 65
0
votes
1 answer

File upload via Swagger UI

Is there a way to demonstrate file uploads using Restler via Swagger UI? I like to be able to do something like: function post() { return $_FILES; } And expect to see the $_FILES array content displayed as a result of swagger ajax call. Is…
Antoan Milkov
  • 2,152
  • 17
  • 30
0
votes
1 answer

Problems in Restler 3 API Explorer

I'm trying to use Restler 3 API Explorer and i'm having some problems. Even though i put "@param int $n1" in the comment, in the API Explorer it shows the parameters as string. Besides that, the API Explorer only shows the "Response Information"…
elisoff
  • 58
  • 1
  • 8
0
votes
1 answer

Change the color in the Swagger API explorer documentation

I am implementing API calls that are used to delete data in 2 ways via DELETE and GET requests: @url DELETE /{id} @url GET /delete/{id} Is there a way to make the Swagger to color in red the GET request too? They are used for same purpose - to…
Antoan Milkov
  • 2,152
  • 17
  • 30
0
votes
1 answer

Restler 3, php, verbs. How work path?

I have a problem. How work path in Restler 3? class eventos { function index($desde=0, $hasta=0) {} function get($num, $p2='optional') { if($p2 != 'attend'){} else{} } function post($num, $p2, $request_data = null){ …
daicon
  • 181
  • 3
  • 15
0
votes
0 answers

Restler3: DELETE Body JSON

I really don't understand what I should do to make a DELETE request. I want to use JSON as in/output only, so also a DELETE request should receive JSON. But that doesn't make the goal: public function delete($request_data = NULL) $request_data is…
user1289915
0
votes
1 answer

Error on Restler response in Restangular

I've been at this for a couple days and can't seem to get this to work. My issue is that I'm using Restler (version 3) for an API and Restangular on my front end and I'm getting the following error: Error: can't convert undefined to object…
andykim88
  • 1
  • 2
0
votes
1 answer

Restler-3: index()-function

I'm playing around with Restler3 (really awesome!) and noticed a problem. So, the index() function should list all rows of a table, that's correct, right? I'm doing it that way: index() lists all rows of a table. But the client doesn't support to…
user1289915
0
votes
1 answer

node js restler result "get" not complete when trying to return result

I'm trying to get the HTML of a website using restler. But when I try to get the relevant part of result, I always get the error, "TypeError: Cannot read property 'rawEncoded' of undefined". 'rawEncoded' sometimes is 'res'. I think it changes…
rich
  • 11
  • 4
0
votes
2 answers

Luracast Restler Validator returns warning about expecting string, getting array

I'm sending the following json: {"name":"New event"} to a PATCH handler: function patch($id, $request_data = NULL) but am getting the following warning: Warning: strlen() expects parameter 1 to be string, array given in…
Lys777
  • 426
  • 1
  • 3
  • 11
0
votes
3 answers

Using SwiftMailer inside Restler class

Trying to figure out how to use SwiftMailer inside Restler. I think I may just be including it incorrectly. Per the SwiftMailer documentation, all I need to do is include a single file via require_once and their autoloader does all the magic, but I…
Andrew Bucklin
  • 699
  • 8
  • 19
0
votes
1 answer

Download binary stream data from browser using PHP with web service " downloaded file is corrupted "

My Goal : I want to make certificate and download it . I have the following scenario : in outlines : request : browser ---> PHP page ---> PHP Rest web service ---> bash response : bash ---> PHP Rest web service ---> PHP page ---> browser in…
SafeY
  • 287
  • 2
  • 6
  • 18
0
votes
1 answer

restler: Multi-format issue on formats other than xml or json

I am having an issue with restler, although I registered the following formats: $r->setSupportedFormats('JsonFormat','XmlFormat','YamlFormat','PlistFormat','AmfFormat'); formats other than JSON or xml are not routable using the suffix,…