Author |
Message
|
saviobarr |
Posted: Wed Apr 18, 2018 10:22 am Post subject: Sending String over HTTP Request |
|
|
Centurion
Joined: 21 Oct 2014 Posts: 100 Location: Sao Paulo, Brazil
|
Hi everyone,
I need to send an String to a back end, via HTTP POST (using HTTP Request node). The message must contain a String (not XML neither JSon. Just a text). I am not sure which domain should I use. I tried BLOB, but it didn't work.
Using CURL in command line, it works like below:
curl -X POST "http://myBackEnd.com" -H "Content-Type: application/x-www-form-urlencoded" -d "Here goes the text"
Please, which is the suitable domain?
Many thanks
Savio _________________ Go as far as you can go. Then go farther! |
|
Back to top |
|
 |
souciance |
Posted: Wed Apr 18, 2018 10:53 am Post subject: |
|
|
Disciple
Joined: 29 Jun 2010 Posts: 169
|
Did you try with the DFDL or MRM parser depending on your version? |
|
Back to top |
|
 |
saviobarr |
Posted: Wed Apr 18, 2018 11:14 am Post subject: |
|
|
Centurion
Joined: 21 Oct 2014 Posts: 100 Location: Sao Paulo, Brazil
|
souciance wrote: |
Did you try with the DFDL or MRM parser depending on your version? |
Did you mean, something like
SET OutputRoot.DFDL = 'Here goes my text';
? _________________ Go as far as you can go. Then go farther! |
|
Back to top |
|
 |
Vitor |
Posted: Wed Apr 18, 2018 11:46 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
saviobarr wrote: |
souciance wrote: |
Did you try with the DFDL or MRM parser depending on your version? |
Did you mean, something like
SET OutputRoot.DFDL = 'Here goes my text';
? |
No, something that references a DFDL schema like:
Code: |
SET OutputRoot.DFDL.Schema.TheText = "Here goes my text'; |
where you've developed the schema and added the element.
BLOB is another option but as you've simply said "it didn't work" it's impossible to advise you on what went wrong.
I'm also somewhat cynical of the business value of a URL which accepts a piece of free form text, of indeterminate length, as an input. I fail to see what the receiving application could usefully do with such a string. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
andrewfemin |
Posted: Wed Apr 18, 2018 11:05 pm Post subject: Re: Sending String over HTTP Request |
|
|
 Acolyte
Joined: 26 Aug 2017 Posts: 54
|
saviobarr wrote: |
I tried BLOB, but it didn't work. |
How did it not work? What is the error you're getting? |
|
Back to top |
|
 |
saviobarr |
Posted: Thu Apr 19, 2018 1:26 am Post subject: |
|
|
Centurion
Joined: 21 Oct 2014 Posts: 100 Location: Sao Paulo, Brazil
|
Quote: |
I'm also somewhat cynical of the business value of a URL which accepts a piece of free form text, of indeterminate length, as an input. I fail to see what the receiving application could usefully do with such a string |
I agree, but since the backend belongs to a external partner, I have no control on how the data are transfered. _________________ Go as far as you can go. Then go farther! |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Apr 19, 2018 6:13 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
When you sent the BLOB, did you also set the appropriate HTTPHeader saying 'Content-type = Application Text'  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|