Do you guys know if there is an application that enables me to use GET, PUT, DELETE HTTP methods in a simple way?
I want to run it against Google's BigTable.
Thanks a lot.
curl? It has a command-line client as well as libraries (written in C, but with bindings for all the major languages).
You can specify custom methods with -X:
curl -X DELETE mysite.appspot.com/foo
In the library, you use the CURLOPT_CUSTOMREQUEST option.
If you're using Windows, try Fiddler. It not only does logging of browser to server traffic but can also create requests in its own right.
Related
what is the best way to handle Json api request in symfony?
for example I have api of customers that allowed me to add new customer, edit and delete, and read as well
my question is how to develope it in symfony, as a bundle? like i have a database? with entity class?
if you have any tutorial it will be great
As a Client:
You can use Guzzle to make HTTP calls for you and then convert the json responses using native json_decode.
Other option is to use a Rest client, you will find many of them on packagist, here is one:
https://packagist.org/packages/Mashape/unirest-php
As a Server:
FOSRestBundle, its gonna provide you with many features that you'll need. here is a tutorial:
http://williamdurand.fr/2012/08/02/rest-apis-with-symfony2-the-right-way/
Of course you should check for more sources as well, I have a project of my own which uses it and you can check some code:
https://github.com/renatomefidf/sammui
You can also check the LiipHelloBundle for other multiple usages and examples:
https://github.com/liip/LiipHelloBundle
Good luck!
I am trying to use the plivo.com api with Filemaker to send SMS with my database.
I am using "insert from URL" to POST to the api, like below:
(ACCOUNTID, FROMNUMBER, and TONUMBER has been switched out)
httpspost://api.plivo.com/v1/Account/ACCOUNTID/Message/{"src":"FROMNUMBER", "dst":"TONUMBER", "text":"Testing text"}
The plivo site said something about using JSON for receiving, I had tested with other Filemaker solutions (FmSms) and confirm the functionality is working, so it has to be my post query is in the wrong format.
Would be great if someone of experience can give me some pointer in solving this issue.
Linkage to Plivo's documentation regarding messaging
Thanks in advance
Sunny
This will not work with FileMaker alone. The webservice accepts content-type application/json, FileMaker can send x-www-form-urlencoded only.
It may be possible to use a web viewer with some javascript to handle the request and return data back to FileMaker. See the blog post here: http://www.soliantconsulting.com/blog/2014/11/filemaker-and-javascript-ajax-post
Also, the free base elements plugin will allow you to set custom headers and should also work.
I have developed an app that use a RESTful API using JSON:
- Server side: PHP
- Mobile side: JavaScript or AS3 - XHTTPRequest (AJAX)
Each time I request data to server from mobile I send "{user, password, info request}", and I have developed my own algorithm to encrypt these data before sending them.
Probably I can use HTTPS to send data in a safer way, and I can use SESSION info to avoid the need of sending user/password in each request.
This is not the problem, the problem is that I have the sense of being reinventig the wheel because this issue must be solved already in a million ways (almost every app needs info exchange with a server through HTTP/HTTPS).
I have found lots of link in stackoverflow talking about using JSON/REST but no one talking about an specific standard protocol.
I have found other places with info:
http://openmobilealliance.org/
https://core.telegram.org/mtproto
wikipedia: Wireless Application Protocol
But I am not sure about the better way for doing it.
Any sugestion?, any tutorial, specification, example or case of use link?
Thanks a lot.
J. Pablo.
Firebase is one that I've heard of and haven't used yet. https://firebase.google.com/
I am currently building one using JWT and Laravel, and have been pretty happy with it. Using this link as a guide: https://scotch.io/tutorials/role-based-authentication-in-laravel-with-jwt
To begin with I am a novice, both with REST and cURL. This is what I want to do:
I want to query the Twitter Rest API using commandline (some bash script) and hence, I want to use cURL to do that.
I have been trying to search for some tutorial (with no luck) that explains how to use REST with cURL and how to form the headers, get/post and then how to receive the REST response and the response status, so that I can write my logic based on the response status.
I would greatly appreciate if you can give me a few examples on how to call the twitter REST API using curl and also how to access the REST response status.
I tried calling twitter using this:
curl "http://api.twitter.com/1/statuses/user_timeline.json?include_entities=true&screen_name=$user_name&count=150"
And got a json which I was able to use in my program. But I am not sure how to access the rest response status codes (in order to make my implementation more reliable). Also, I am not sure about what other flags should I provide to the cURL while calling it.
PS: Just to add, if you think there is some other MUCH better alternative to retrieving data from REST API other that using cURL, then also please let me know. Though my application is not web based and is more data crunching oriented and that's why I chose commandline and bash.
curl -i will print out the header information:
HTTP/1.1 200 OK
Date: Sat, 29 Dec 2012 07:34:00 GMT
I know it doesn't directly answer your question, but I'd suggest using Python instead of bash, for a number of reasons. And if you decide on that, I strongly recommend the marvellous Requests library: http://docs.python-requests.org
I would like to know how can I hit a web page programmatically and silently using C/C++?
I tried ShellExecute (shellapi.h), don't know how to make use of it?
Use the HTTP protocol directly
netcat
curl
wget
HTTP Client Services
On linuxen there are perl implemented CLI commands (GET, PUT, POST), in short: pick one from a vast array; you platform will have tools too.
Simplistic example:
type request.http | netcat mywebserver:80
Where request.http could be as simple as
GET /
(mind the trailing empty lines, which SO helpfully hides)