Hello,

I am working with makeRequest of method POST and PUT - both should
receive JSON data and return URI + ETAG, also in JSON. The POST
request works fine, it takes my data and returns the URI + ETAG (in
form of a JSON object)
When I send the PUT request, I also fill the HEADER field "if_match"
assigning the ETAG + the target URL contains the URI.

function putDataToChartGeneration(url, postdata)
{

  var params = {};

  params[gadgets.io.RequestParameters.METHOD] =
gadgets.io.MethodType.PUT;
  params[gadgets.io.RequestParameters.POST_DATA]= postdata;
  params[gadgets.io.RequestParameters.CONTENT_TYPE] =
gadgets.io.ContentType.JSON;

  params[gadgets.io.RequestParameters.HEADERS] = { "if_match" :
sc.getETag() };

  gadgets.io.makeRequest(url, responseDataToChartGeneration, params);

}



Response:

function responseDataToChartGeneration(obj)
{
...

Problem is that the PUT request does not return anything in "obj.data"
section, there is no javascript JSON object. In "obj.text" there is
also no sign of my URI or ETAG - it only contains the postdata (some
JSON in text format).

Strange thing is that the return code is set to 200, there are no
errors and if "obj.text" contains JSON, shouldn't it be parsed into
"obj.data".


I also ran the same PUT request via the RestClient under irb, there
the result was as expected, I got the ETAG and the URI information
back - no sign of the postdata.


Is there something obvious I missed, or are there any code samples
that show how to use makeRequest-PUT in version 0.8?

Regards, Markus

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Orkut Developer Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/opensocial-orkut?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to