10-02-2017 12:32 PM
I have a pipeline that goes through some work manipulating data, then starts using a XML Generator Snap to make a bunch of XML documents that need to get PUT to a REST API. Simplified, example of a document.
[ {"xml":"<?xml version="1.0" encoding="UTF-8"?><import-record type-id="14417"><native><field name="title"><text>Some Title</text></field></native></import-record>"}]
Based on that document in the REST PUT, I set the HTTP entity to $xml, and then I inspect whats’s being PUT on the other side, instead of seeing the XML document as the body of the PUT I’m getting an array of 1 string with the XML document. How do I get this just to PUT the doucment directly. Example of what I’m getting on the receiving side below:
["<?xml version=\"1.0\" encoding=\"UTF-8\"?><import-record type-id..."]
Overview of Pipeline in case it helps to talk about it:
Solved! Go to Solution.
10-02-2017 01:01 PM
@mike.korcynski, check the Batch Size setting in the Snap - if it isn’t blank (for example, it has a value of 1
), you’ll see the kind of behavior you’re describing:
If you leave it blank, it should not wrap the body in an array (also, be mindful of the correct Content-Type header value required by the targeted API):
The setting in question is described further on the REST PUT documentation page:
10-02-2017 01:01 PM
@mike.korcynski, check the Batch Size setting in the Snap - if it isn’t blank (for example, it has a value of 1
), you’ll see the kind of behavior you’re describing:
If you leave it blank, it should not wrap the body in an array (also, be mindful of the correct Content-Type header value required by the targeted API):
The setting in question is described further on the REST PUT documentation page:
10-02-2017 01:08 PM
I had the Content-Type set correctly, but Batch size I had set to 1, setting it back to blank solved the problem. Thanks, I appreciate the help.