Skip to content

Instantly share code, notes, and snippets.

@avernet
Created April 4, 2019 16:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avernet/3b6d6195bd30c9f6cc71a21244a1d66a to your computer and use it in GitHub Desktop.
Save avernet/3b6d6195bd30c9f6cc71a21244a1d66a to your computer and use it in GitHub Desktop.
Sending HTTP headers with an `xf:submission`
<xh:html xmlns:xh="http://www.w3.org/1999/xhtml"
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fr="http://orbeon.org/oxf/xml/form-runner">
<xh:head>
<xf:model>
<xf:instance>
<first-name xmlns=""/>
</xf:instance>
<xf:submission
id="my-submission"
ref="instance()"
resource="http://httpbin.org/post"
method="post"
replace="all">
<xf:header>
<xf:name>My-Name</xf:name>
<xf:value>My-Value</xf:value>
</xf:header>
</xf:submission>
</xf:model>
</xh:head>
<xh:body>
<xf:trigger>
<xf:label>Submit</xf:label>
<xf:send event="DOMActivate" submission="my-submission"/>
</xf:trigger>
</xh:body>
</xh:html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment