Request Headers with DataPipeline HttpRequest
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://code.google.com/p/opensocial-resources/issues/detail?id=1298