Skip to content

Instantly share code, notes, and snippets.

@albinkjellin
Created February 23, 2015 22:09
Show Gist options
  • Save albinkjellin/85a0983c38695090d2c7 to your computer and use it in GitHub Desktop.
Save albinkjellin/85a0983c38695090d2c7 to your computer and use it in GitHub Desktop.
file2rest
<http:request-config name="HTTP_Request_Configuration" host="localhost" basePath="api" port="8884" doc:name="HTTP Request Configuration"/>
<flow name="file2rest" doc:description="Reads a file from your desktop and sends that to a rest service.">
<file:inbound-endpoint path="src/test/resources/rest/attachment/in" responseTimeout="10000" doc:name="File"/>
<file:file-to-byte-array-transformer doc:name="File to Byte Array"/>
<set-attachment attachmentName="#[originalFilename]" value="#[payload]" contentType="multipart/form-data" doc:name="Attachment"/>
<http:request config-ref="HTTP_Request_Configuration" path="contact/abc/datasheet" method="POST" doc:name="HTTP" parseResponse="false"/>
</flow>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment