# String manipulation for requests body

**URL:** <https://forum.knime.com/t/string-manipulation-for-requests-body/28729>\
**Category:** KNIME Analytics Platform\
**Created:** [November 15, 2020, 2:10pm UTC](https://forum.knime.com/t/string-manipulation-for-requests-body/28729 "2020-11-15T14:10:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cason](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/c/f475e1/32.png) [@cason](https://forum.knime.com/u/cason)\
**Post date:** [November 15, 2020, 2:10pm UTC](https://forum.knime.com/t/string-manipulation-for-requests-body/28729/1 "2020-11-15T14:10:49Z")

</div>

Hi,

I’m trying to dynamically build a request body using the String Manipulation node that should then be used as the request body in downstream POST request node. The correct request body looks like this:

{ “niche”: “SomeNicheValueHere”, “title”: “SomeTitleValueHere” }

In my input data I have ATTR1 and ATTR2 that should replace SomeNicheValueHere and SomeTitleValueHere dynamically. Trying to build this via the join() function in String Manipulation just generates a bunch of errors, I think primarily since the actual body contains “” which messes with the join() function.

Could anyone please help me with ideas on how to construct the String Manipulation function?  
Thank you in advance!

---

<div class="post-metadata">

**Author:** ![danielesser](https://forum-cdn.knime.com/user_avatar/forum.knime.com/danielesser/32/331_2.png) [@danielesser](https://forum.knime.com/u/danielesser)\
**Post date:** [November 15, 2020, 3:00pm UTC](https://forum.knime.com/t/string-manipulation-for-requests-body/28729/2 "2020-11-15T15:00:15Z")

</div>

Hi @cason,

I wouldn’t concern with the [String Manipulation Node](https://nodepit.com/node/org.knime.base.node.preproc.stringmanipulation.StringManipulationNodeFactory), but instead use the [Table to JSON Node](https://nodepit.com/node/org.knime.json.node.fromtable.TableToJsonNodeFactory). It converts your input table row-wise into JSON objects. You can then loop over these JSON objects and perform POST requests for each of them.

A lot cleaner and a way less headaches 😁

I added you an example workflow to my NodePit Space:

> **[string-manipulation-for-requests-body-28729 \[Workflow\] — NodePit](https://nodepit.com/workflow/com.nodepit.space/daniel/public/forum/string-manipulation-for-requests-body-28729.knwf)**
>
> Use data table in table, convert it to JSON and POST it to an URL. This workflow is meant as a solution for thos KNIME forum post: https://forum.knime.com/t/string-manipulation-for-requests-body/28729

Best regards,  
Daniel

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [May 17, 2021, 3:00am UTC](https://forum.knime.com/t/string-manipulation-for-requests-body/28729/3 "2021-05-17T03:00:23Z")

</div>

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
