[rabbitmq-discuss] RabbitMQ JSON-RPC via GET rather than POST

Emile Joubert emile at rabbitmq.com
Tue Jun 29 12:09:48 BST 2010


Hi Donovan,

Sorry for the delay in getting back to you. I can confirm that "open" is
not idempotent which means it is not permitted to be accessed via HTTP GET.

Unfortunately I don't have a good alternative suggestion. The use of a
proxy to get around the cross-domain restrictions on POST in jQuery may
work, but I can hardly recommend it as good practice.

Regards

Emile




On 02/06/10 16:04, Donovan wrote:
> Hi,
> 
> This:
> 
> curl "http://dev.rabbitmq.com/rpc/rabbitmq" -d '{"version":"1.1","id":
> 2,"method":"open","params":["guest","guest",5,null]}'
> 
> return this:
> 
> {"version":"1.1","id":2,"result":
> {"service":"6EEAADDC83484475E58A4AC1C5AB3D9D"}}
> 
> Quoting from here:
> http://hg.opensource.lshift.net/erlang-rfc4627/raw-file/a800c54e7ff3/doc/index.html
> 
> <Quote>
> Similarly, any idempotent methods provided by a service may be
> accessed via POST to the base URL for the service, or via GET to a URL
> of the form
> 
> http://localhost:5671/rpc/ServiceName/MethodName?arg=value&..
> </Quote>
> 
> I'm trying to create the equivalent GET version of the POST curl
> above, so that I can do JSON-RPC across domains. POST is not permitted
> by browsers when using jQuery, annoyingly!!!
> 
> I tried:
> 
> curl "http://dev.rabbitmq.com/rpc/rabbitmq/open?
> username=guest&password=guest&sessionTimeout=5"
> 
> and got:
> 
> {"version":"1.1","id":null,"error":{"name":"JSONRPCError","code":
> 403,"message":"Non-idempotent method","error":"open"}}
> 
> Any help much appreciated!!
> 
> Cheers,
> Donovan.
> 
> 
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss



More information about the rabbitmq-discuss mailing list