jarkko
12 years agoOccasional Contributor
[Resolved]HTTP Test Request vs inline files
Hello,
I am using soapUI Pro 4.6.0.
I am trying to do a test step that sends a straight forward HTTP POST to certain endpoint. This is easy enough if I copy-paste the desired request contents directly to the request editor (the free text area in "Request" tab).
however I am not currently able to "inline" this content from external file!
Sure enough I can create an "Attachment" out of this external file and then type the name of the attachment in request body. That way the contents of the file do get included in outgoing http request - but the resulting raw http request is completely different from the desired.
What I would like to send is:
--- request starts here ---
POST https://host.name.com/service HTTP/1.0
Content-Type: text/plain
Content-Length: 63
Host: host.name.com
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
THIS_IS_THE_TEXT_I_WANT_TO_INLINE
THERE_IS_LOTS_OF_TEXT_IN_HERE
--- request end here ---
What I get by using attachments is:
--- request starts here ---
POST https://host.name.com/service HTTP/1.0
Content-Type: text/plain; boundary="----=_Part_20_24250050.1382532907669"
MIME-Version: 1.0
Content-Length: 493
Host: host.name.com
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
------=_Part_20_24250050.1382532907669
Content-Type: text/plain; charset=UTF8
Content-Transfer-Encoding: 8bit
inline.txt
------=_Part_20_24250050.1382532907669
Content-Type: text/plain; charset=UTF8; name=inline.txt
Content-Transfer-Encoding: quoted-printable
Content-ID: <inline.txt>
Content-Disposition: attachment; name="inline.txt"; filename="inline.txt"
=EF=BB=BFTHIS_IS_THE_TEXT_I_WANT_TO_INLINE
THERE_IS_LOTS_OF_TEXT_IN_HERE
------=_Part_20_24250050.1382532907669--
--- request end here ---
Reading the help pages I do get the impression, that inline files might be the feature I am looking for. But how do I inline the raw contents of an external file into body of the HTTP POST request without any encoding or additional headers?
I did also try typing something like "file:C:\inline.txt" in the request body, but that did not get replaved by files contents either. Maybe this works in SOAP requests only?
//Jarkko Siitonen
I am using soapUI Pro 4.6.0.
I am trying to do a test step that sends a straight forward HTTP POST to certain endpoint. This is easy enough if I copy-paste the desired request contents directly to the request editor (the free text area in "Request" tab).
however I am not currently able to "inline" this content from external file!
Sure enough I can create an "Attachment" out of this external file and then type the name of the attachment in request body. That way the contents of the file do get included in outgoing http request - but the resulting raw http request is completely different from the desired.
What I would like to send is:
--- request starts here ---
POST https://host.name.com/service HTTP/1.0
Content-Type: text/plain
Content-Length: 63
Host: host.name.com
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
THIS_IS_THE_TEXT_I_WANT_TO_INLINE
THERE_IS_LOTS_OF_TEXT_IN_HERE
--- request end here ---
What I get by using attachments is:
--- request starts here ---
POST https://host.name.com/service HTTP/1.0
Content-Type: text/plain; boundary="----=_Part_20_24250050.1382532907669"
MIME-Version: 1.0
Content-Length: 493
Host: host.name.com
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
------=_Part_20_24250050.1382532907669
Content-Type: text/plain; charset=UTF8
Content-Transfer-Encoding: 8bit
inline.txt
------=_Part_20_24250050.1382532907669
Content-Type: text/plain; charset=UTF8; name=inline.txt
Content-Transfer-Encoding: quoted-printable
Content-ID: <inline.txt>
Content-Disposition: attachment; name="inline.txt"; filename="inline.txt"
=EF=BB=BFTHIS_IS_THE_TEXT_I_WANT_TO_INLINE
THERE_IS_LOTS_OF_TEXT_IN_HERE
------=_Part_20_24250050.1382532907669--
--- request end here ---
Reading the help pages I do get the impression, that inline files might be the feature I am looking for. But how do I inline the raw contents of an external file into body of the HTTP POST request without any encoding or additional headers?
I did also try typing something like "file:C:\inline.txt" in the request body, but that did not get replaved by files contents either. Maybe this works in SOAP requests only?
//Jarkko Siitonen