restler

Restler3 RC4: oAuth doesn't work

孤者浪人 提交于 2019-12-11 18:05:03
问题 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 stays empty. What did I wrong? I set all permissions recursively to 777 and installed any dependencies from composer (I'm new to composer). But the stuff got downloaded to restler's vendor folder so it's there. Thank's for reading and answering. Jan

how to POST data using Curl in php?

喜你入骨 提交于 2019-12-11 06:29:48
问题 I have created webservices in restler framework and I am trying to insert data using curl in php from client lib that I have created. api.php /** * Manually routed method. we can specify as many routes as we want * * @url POST addcomment/{token}/{email}/{comment}/{story_id} */ function addComment($token,$email,$comment,$story_id){ return $this->dp->insertComment($token,$email,$comment,$story_id); } for testing purpose from client : testing.php $data_string = "token

Handling file uploads with Restler

廉价感情. 提交于 2019-12-11 04:48:10
问题 What is the best practice to implement file uploads using Restler framework? I like to have a API call that get the file save it in CDN and return back the CDN file URL to the caller. What is the best way to implement it? 回答1: File upload to CDN using our API This requires two steps, first is to get the file on the API server. add UploadFormat to the supported formats Adjust the static properties of UploadFormat to suit your need From your api method use $_FILES and move_uploaded_file to get

How to log all requests in PHP Restler 3?

南楼画角 提交于 2019-12-10 19:23:05
问题 I have created an API with Luracast Restler 3 RC 6 (https://github.com/Luracast/Restler/tree/3.0.0-RC6) and now I want to create a logging into my API so that every request made for the API will be logged. I've tried to search for the answer pretty much everywhere, without luck. So my question is: How can I create a logging class/function into Restler 3, which gets called everytime when a request is made? Should it be somehow implemented into routing, or what? I need something like: logging(

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

不打扰是莪最后的温柔 提交于 2019-12-08 10:30:13
问题 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 details : REst web service called from php page does next : makes certificate in bash and exports it as pfx file . returns certificate from bash file as byte stream . hexdump -b $exportedcert returned output from web service is bytes (this is just a part

AWS PHP SDK 2 (aws.phar) does not work with Restler Framework

只愿长相守 提交于 2019-12-08 00:25:44
问题 I have been testing some PHP scripts that uses the aws-sdk-php to upload files to S3 storage. These scripts seems to work nicely when they are executed directly from the browser, but fails when trying to use it through an API class in Luracast Restler 3.0 A sample script that upload some dummy file is like the following: <?php require_once (dirname(__FILE__) . "/../lib/aws/aws.phar"); use Aws\Common\Aws; use Aws\S3\Enum\CannedAcl; use Aws\S3\Exception\S3Exception; use Aws\Common\Enum\Region;

AWS PHP SDK 2 (aws.phar) does not work with Restler Framework

冷暖自知 提交于 2019-12-06 05:44:53
I have been testing some PHP scripts that uses the aws-sdk-php to upload files to S3 storage. These scripts seems to work nicely when they are executed directly from the browser, but fails when trying to use it through an API class in Luracast Restler 3.0 A sample script that upload some dummy file is like the following: <?php require_once (dirname(__FILE__) . "/../lib/aws/aws.phar"); use Aws\Common\Aws; use Aws\S3\Enum\CannedAcl; use Aws\S3\Exception\S3Exception; use Aws\Common\Enum\Region; function test(){ // Instantiate an S3 client $s3 = Aws::factory(array( 'key' => 'key', 'secret' =>

AFNetworking AFHTTPClient Class

坚强是说给别人听的谎言 提交于 2019-12-05 11:32:45
I’m fairly new to iOS programming, especially when it comes to webservices. I’m developing a App for academic purposes, and I need to communicate with my server, currently using AFNetworking2 and Restler/php, everything work when it comes to GET methods. But I can’t upload anything. Been reading for hours, in github support site, stackoverflow, pretty much all examples/questions to upload images (and there are a LOT) use this line: AFHTTPClient *client = [AFHTTPClient clientWithBaseURL:[NSURL URLWithString:@"http://server"]]; I do have a Client class, subclass of AFHTTPSessionManager, with my

Using node and restler for multipart form-data POST

我是研究僧i 提交于 2019-12-05 07:42:05
问题 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 correct: restler.post("http://posttestserver.com/post.php", { multipart: true, data: { "upload": restler.data("people.csv", "text/csv", '384;213;Status Update'), "returnURL": "" } }).on("complete", function(data) { console.log(data); }); Unfortunately

Restler always returns 404: Not found

给你一囗甜甜゛ 提交于 2019-12-03 18:10:03
问题 I have installed Restler on my local server to test and make some APIs for my project. Api requests are handled via http://localhost/myproject/api/ . The problem is that everytime i try to make a request i get the following error: { "error": { "code": 404, "message": "Not Found" }, "debug": { "source": "Routes.php:383 at route stage", "stages": { "success": [ "get" ], "failure": [ "route", "negotiate", "message" ] } } } Also this is my .htaccess : RewriteEngine on RewriteBase / RewriteCond %