[rabbitmq-discuss] accessing rabbitmq with json-rpc

hufflepuff at hush.com hufflepuff at hush.com
Sat Jun 18 16:11:04 BST 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm trying to access my rabbitmq server using the json-rpc plugin
on my local machine using a js client (specifically, jquery).

Specifically, if I followed the examples correctly, I'm trying to
POST my requests to http://localhost:55670/rpc/rabbitmq

The problem I have is firefox blocking my request or rather turning
it into a preflight OPTIONS request, for which the corresponding
server should reply with some message allowing CORS (which rabbitmq
obviously doesn't do).

The examples in the plugin rabbitmq_jsonrpc_channel_examples don't
have this problem, since they sit on the same port, and are not
subject to CORS.

I got this problem only when I changed the contentType in my ajax
request to application/json. Apparently, this contentType requires
CORS, whereas the default application/x-www-form-urlencoded is
considered safe. Sending the data as application/x-www-form-
urlencoded doesn't get you any reply from rabbitmq.

I have no problem POSTing to rabbitmq with curl, so this is
obviously due to the limitation of the browser.

What am I doing wrong? Is it even possible to send a POST request
to rabbitmq without changing the example plugin and loading it
straight into rabbitmq? Otherwise (sorry if this sounds rude) what
is the point of json-rpc?

Maybe this is a really trivial question, but I've been looking for
an answer for the better part of the day.

Some references from what I've dug up:
https://groups.google.com/group/rabbitmq-
discuss/browse_thread/thread/5d3ad18f7c48b020?fwc=1

Thanks in advance
Jason
-----BEGIN PGP SIGNATURE-----
Charset: UTF8
Version: Hush 3.0
Note: This signature can be verified at https://www.hushtools.com/verify

wsBcBAEBAgAGBQJN/MAIAAoJEL7Kanawu8RE5YoH/RkA1YbYeer2ozfwEzF28Eb+wh4F
MpeLBlUtF+C2PFR8xo4yrt28pmGSFpvCTjwG/h35HuO3AxifM8x8eJSlmtBaQ+ffwfRu
s2Qupje5RhhG6iOFF9Akr4ZnhTfpIwqfYSKdN9HNtF+vp4uG/VY+KUiic/f1MQnBICOn
rfA4E5v6yvadsHXJI3Q7NEQHgIYcF4R4mTfzgR5dqtg9OEMEZWSqqy3wgADjx6GtykWs
0+uHafWiJzpafJaTQtqP7SrBL0XHmTyutS+402GNKXwpG+JFX94DDawdsfuhIl+hS3pj
tM/uX595tA6BEF5pBkRUe9F0IdIYhOPdtnQ9er4jOxs=
=8wUa
-----END PGP SIGNATURE-----



More information about the rabbitmq-discuss mailing list