Undefined headers attribute on os:HttpRequest
mmarum-sugarcrm opened this issue · 0 comments
Original author: jasn...@gmail.com (April 11, 2012 00:00:10)
SPECIFICATION BUGS ONLY - Description
=====================================
Section 14.4 of Core-Gadget currently specifies... that os:HttpRequest "MUST support all of the fields in HTTP-Request-Params as attributes."
One of the HTTP-Request-Params is "HEADERS" which is defined as a Map<String,String>. Unfortunately, the spec does not define how to represent a Map<String,String> as the value of an attribute making it impossible to completely meet this requirement in an interoperable way. We need a way of representing headers in XML format if we're going to continue supporting this option at all.
There are two options...
- JSON-Stringify the Map<String,String> and use that as the XML attribute value which is "simple" but ugly as hell, or
- Provide a more structured approach to defining the request parameters associated with the request: e.g. instead of using attributes, we can use Param elements...
<os:HttpRequest key="..." method="get" href="...">
<os:Param name="format" value="text" />
<os:Param name="headers">
<os:Param name="X-Foo-Header" value="blah blah blah" />
<os:Param name="Prefer" value="lenient" />
</os:Param>
</os:HttpRequest>
(http://docs.opensocial.org/display/OSD/Request+Headers+with+DataPipeline+HttpRequest)
Document affected:
==================
1.) Please attach a patch for the document if appropriate.
2.) Post a thread at
http://groups.google.com/group/opensocial-and-gadgets-spec/topics
linking to this issue report.
3.) Post a comment on this issue, linking back to the thread.
Original issue: http://code.google.com/p/opensocial-resources/issues/detail?id=1298