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

How to make POST request in Restler Client?

I'm using Restler 3 library and I want to make a post request from php . I tried this way : POSTing JSON Data With PHP cURL $data=array('name'=>'ddddd','email'=>'sdfsdf@sdgdsg'); …
SafeY
  • 287
  • 2
  • 6
  • 18
0
votes
1 answer

force download on restler function call

I got the following function in restler /** * get updateFiles by name * * one could get the last update file * * @status 201 * @return file */ function getupdateFile($filename) { $file = 'Plakat.jpg'; if (file_exists($file)) { …
Inge
  • 427
  • 7
  • 20
0
votes
1 answer

Adding user groups to Luracast Restler API

I'm trying to add user groups in my API developed using Luracast Restler using the example class "AccessControl" which implements the iAuthenticate class from Restler. Files: https://gist.github.com/anonymous/d6a315d1f29dc7722b7d The problem I'm…
John Doe
  • 298
  • 1
  • 3
  • 16
0
votes
1 answer

File Upload with Restler v3

Just recently, support for multipart/form-data upload was added to Restler v3 (source) but I can't get it to work. In my index.php file, I've added: $r->setSupportedFormats('JsonFormat', 'UploadFormat'); When I post a .txt file, I get the following…
Andrew Bucklin
  • 699
  • 8
  • 19
0
votes
1 answer

Request and Response Headers Override using Restler

I am new to restler and trying to do the following things, can't seem to get hold of it I have this class and method exposed via Restler class Account { protected $Api_Version = array('version' => "1.0.2.1234", 'href' => "/"); // Returns the…
Narsi
  • 1
  • 2
0
votes
1 answer

Using node and restler for multipart form-data POST

I am able to upload a file using restler.file in the data section with no problem. I am now trying to write a very short CSV data string, which I am not able to find documentation for the data function, but reading the code I thought I had it…
liquidki
  • 1,234
  • 16
  • 16
0
votes
1 answer

Reserved word in restler 3?

i´m a bit confused about using optional parameters and phpdocs. I got the following @url statement: @url GET /pruefvorschrift/:typs now want to set :typs as optional so i do function getpruefvorschrift ($typs=null) {... this isn´t working, value…
Inge
  • 427
  • 7
  • 20
0
votes
1 answer

Smart routing with PHPDoc not working with Restler v3

I am having a bit of an issue implementing the smart url routes in Restler PHP REST Framework v3. Basically it appears as if Restler is ignoring my comments. I have attached my index.php and tests.inc.php files here. What is happening, is even with…
Nate McIntyre
  • 63
  • 1
  • 7
0
votes
2 answers

restler 3 cross domain not working

My restler 3 api works fine on local test server and works fine on production server if calls from that same server, but if I make the call remotely then it fails. Using the same rest client with the luracast online examples it works fine with…
twiddly
  • 11
  • 7
0
votes
2 answers

Post JSON missing parameters

got a class which has a post function which should store a large amaount of parameters to db. The problem is, that i can´t get the send parameters from request body. I tested nearly every combination: add request_data as end parameter -> not…
Inge
  • 427
  • 7
  • 20
0
votes
1 answer

PHP Luracast Restler adding namespace attributes to root element

Been having some trouble with this. How do I add namespace URL attributes to the root? I s that even possible? Any workarounds are welcomed. I have to use some of the definitions from Dublin Core, and my XML requires that the namespace is declared.…
cj5
  • 785
  • 3
  • 12
  • 34
0
votes
1 answer

restler 3 api explorer incorrect param type

first thx for this simple tool! I got the following problem. In my service class i have a function which looks like this (part): /** * get merkmale from device id * * one could get merkmale from given serial id by passing var id * to this…
Inge
  • 427
  • 7
  • 20
0
votes
1 answer

use common database class with restler API

I copied DB/PDO/MySQL.php from the crud example and put that directory structure in one of my API directories (and made changes for use with my database). The API structure is myapi/artists (so the db stuff is myapi/artists/DB/PDO/MySQL.php) and I…
twiddly
  • 11
  • 7
0
votes
1 answer

why i am getting 404 on passing different function name in url?

I don't know how restler behaves. when i am passing getuser/2 it works fine, but when i am passing /getalluser it gives { error: { code: 404, message: "Not Found" } } But when i changed the function name getalluser to buyalluser it works…
ketul shah
  • 413
  • 2
  • 7
  • 17
0
votes
1 answer

Return image using restler

Is it possible to use Luracast Restler to return an image? Something like calling: http://myserver.com/api/users/002/avatar to download a png?
Jelle
  • 1,024
  • 10
  • 18