Erlang/OTP Forums

Author Message

<  Yaws mailing list  ~  jQuery and JSON

Guest
Posted: Sat Apr 19, 2008 1:54 pm Reply with quote
Guest
Hi!

I want to post some JSON data with jQuery.ajax(..) but I receive this
error from Yaws :
3748- fatal: expected_element_start_tag

I think Yaws excepts XML data because of "X-Requested-With:
XMLHttpRequest" in the HTTP header...

Here is a dump of a request example given by Yaws.

{arg,#Port<0.630>,
{{127,0,0,1},54595},
{headers,"keep-alive",
"application/json, text/javascript, */*","localhost:8080",
undefined,undefined,undefined,undefined,undefined,undefined,
"http://localhost:8080/",
"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.13)
Gecko/20080311 Iceweasel/2.0.0.13 (Debian-2.0.0.13-1)",
undefined,[],"300",undefined,"12",
"application/x-www-form-urlencoded",undefined,undefined,
undefined,
[{http_header,1,'Cache-Control',undefined,"no-cache"},
{http_header,4,'Pragma',undefined,"no-cache"},
{http_header,0,"X-Requested-With",undefined,
"XMLHttpRequest"},
{http_header,9,'Accept-Charset',undefined,
"ISO-8859-1,utf-8;q=0.7,*;q=0.7"},
{http_header,10,'Accept-Encoding',undefined,"gzip,deflate"},
{http_header,11,'Accept-Language',undefined,
"en-us,en;q=0.5"}]},
{http_request,'POST',{abs_path,"/request"},{1,1}},
<<"action=hello">>,"/request",undefined,undefined,
"/home/gburri/projets/euphorik","/",
"/home/gburri/projets/euphorik/request",undefined,undefined,
<0.780.0>,[],"/","/",undefined}

The data sended is "action=hello". If I send "action=<hello />" it's all right.
Do I have to enclose my JSON data into XML ?

Thanks in advance.

/gburri

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post recived from mailinglist

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum