Skip to content

Instantly share code, notes, and snippets.

@mathias-goebel
Created April 9, 2020 04:39
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 mathias-goebel/d3e28385a13c6cb9e44e037fded21666 to your computer and use it in GitHub Desktop.
Save mathias-goebel/d3e28385a13c6cb9e44e037fded21666 to your computer and use it in GitHub Desktop.
EXPath HTTP Client post form data – an example
let $parameter1 := "one"
let $parameter2 := "two"
let $parameter3 := "three"
let $boundary := current-dateTime() => util:hash("md5") => substring(0,17)
let $request :=
<hc:request method="POST" href="{ $webauthUrl }" http-version="1.0">
<hc:header name="Connection" value="close" />
<hc:multipart media-type="multipart/form-data" boundary="------------------------{$boundary}">
<hc:header name="Content-Disposition" value='form-data; name="parameter1"'/>
<hc:body media-type="text/plain">{$parameter1}</hc:body>
<hc:header name="Content-Disposition" value='form-data; name="parameter2"'/>
<hc:body media-type="text/plain">{$parameter2}</hc:body>
<hc:header name="Content-Disposition" value='form-data; name="parameter3"'/>
<hc:body media-type="text/plain">{$parameter3}</hc:body>
</hc:multipart>
</hc:request>
return
hc:send-request($request)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment