cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

User post empty body in the request to Ultra task

walkerline117
Contributor

Hi

We are building a Ultra task. Eventually it will be an API that user will post xml data in the body of request to this Ultra task.

One use case is that when user post empty body in the request to this Ultra pipeline, how would I check in the pipeline that user post empty data in the request.

Note that the request will not be in Json format, it will be XML format.

Thanks

1 ACCEPTED SOLUTION

mzubair
New Contributor

If you use a Binary To Document at the start of your pipeline then its output will look like this:

[
  {
    "task_name": "...",
    "content-length": "164190",
    "origin": "chrome-extension://aicmkgpgakddgnaphhhpliifpcfhicfo",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><integrationMessage>...</integrationMessage>",
    "accept-language": "en-US,en;q=0.9",
    "method": "POST",
    "query": {},
    "mytoken":"ABCD1234ABCD1234"
    ...
  }
]

The request body is contained in the โ€œcontentโ€ attribute of the document. Then, for example, you could use a router snap which routes based on the length of content.

View solution in original post

2 REPLIES 2

mzubair
New Contributor

If you use a Binary To Document at the start of your pipeline then its output will look like this:

[
  {
    "task_name": "...",
    "content-length": "164190",
    "origin": "chrome-extension://aicmkgpgakddgnaphhhpliifpcfhicfo",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><integrationMessage>...</integrationMessage>",
    "accept-language": "en-US,en;q=0.9",
    "method": "POST",
    "query": {},
    "mytoken":"ABCD1234ABCD1234"
    ...
  }
]

The request body is contained in the โ€œcontentโ€ attribute of the document. Then, for example, you could use a router snap which routes based on the length of content.

walkerline117
Contributor

Thanks, this helps!