Thanks for the pointers Alf.

I just tried the following nightly build (after a google, it wasn't obvious on 
the site):

jakarta-jmeter-r525254_bin.zip 04-Apr-2007 08:29  2.3M
jakarta-jmeter-r525254_lib.zip 04-Apr-2007 08:29  7.6M

Success!

Using the same test case (which referenced an HTTP Request sampler) the file 
was passed through correctly:

Wireshark capture:

Hypertext Transfer Protocol
    POST /example/path HTTP/1.1\r\n
        Request Method: POST
        Request URI: /example/path
        Request Version: HTTP/1.1
    Connection: close\r\n
    Content-Type: application/x-www-form-urlencoded\r\n
    Content-Length: 119
    User-Agent: Java/1.5.0_11\r\n <----- not curl!
    Host: localhost:1234\r\n
    Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2\r\n
    \r\n
Line-based text data: application/x-www-form-urlencoded
    <!DOCTYPE EXAMPLE SYSTEM "C:\EXAMPLE.dtd">\r\n
    <Doc>\r\n
    <Asset>\r\n
    <Tag Place="Wonderland" Person="Alice" />\r\n
    </Asset>\r\n
    </Doc>

Btw the same result was achieved using the HTTP Request HTTP Client sampler.

Any idea when the next formal release is planned?

Cheers,

Alex

-----Original Message-----
From: Thomson, Alex [mailto:[EMAIL PROTECTED] 
Sent: 12 April 2007 09:09
To: JMeter Users List
Subject: RE: jMeter HTTP POST query

I'm not sure I understand the following ... If you put the "post body" you want 
to send in a file, and then reference the filename in the "Filename" field HTTP 
Request GUI"

The file I reference only contains the following:

<!DOCTYPE EXAMPLE SYSTEM "C:\EXAMPLE.dtd">
<Doc>
<Asset>
<Tag Place="Wonderland" Person="Alice" />
</Asset>
</Doc>

Are you saying I need to include some HTTP protocol information as well as the 
data?

Btw using Jmeter 2.2 and following your instructions with the above file the 
following is recorded by wireshark.

Hypertext Transfer Protocol
    POST /example/path HTTP/1.1\r\n
        Request Method: POST
        Request URI: /example/path
        Request Version: HTTP/1.1
    Connection: close\r\n
    Content-Type: multipart/form-data; 
boundary=---------------------------7d159c1302d0y0\r\n
    User-Agent: Java/1.5.0_11\r\n
    Host: localhost:1234\r\n
    Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2\r\n
    Content-Length: 346
    \r\n
MIME Multipart Media Encapsulation, Type: multipart/form-data, Boundary: 
"---------------------------7d159c1302d0y0"
    [Type: multipart/form-data]
    First boundary: -----------------------------7d159c1302d0y0\r\n
    Encapsulated multipart part:  ()
        Content-Disposition: form-data; name=""; 
filename="C:\\example\\file.xml"\r\n
        Content-Type: \r\n
        \r\n
        Media Type
            Media Type:  (119 bytes)
    Last boundary: \r\n-----------------------------7d159c1302d0y0--\r\n

Rather than the following produced by curl

Hypertext Transfer Protocol
    POST /example/path HTTP/1.1\r\n
        Request Method: POST
        Request URI: /example/path
        Request Version: HTTP/1.1
    User-Agent: curl/7.12.1 (i386-redhat-linux-gnu) libcurl/7.12.1 
OpenSSL/0.9.7a zlib/1.2.1.2 libidn/0.5.6\r\n
    Host: localhost:1234\r\n
    Pragma: no-cache\r\n
    Accept: */*\r\n
    Content-Length: 119
    Content-Type: application/x-www-form-urlencoded\r\n
    \r\n
Line-based text data: application/x-www-form-urlencoded
    <!DOCTYPE EXAMPLE SYSTEM "C:\EXAMPLE.dtd">\r\n
    <Doc>\r\n
    <Asset>\r\n
    <Tag Place="Wonderland" Person="Alice" />\r\n
    </Asset>\r\n
    </Doc>

I'll try using the nightly build if I can find it :-)

-----Original Message-----
From: Alf Høgemark [mailto:[EMAIL PROTECTED] 
Sent: 11 April 2007 16:39
To: JMeter Users List
Subject: Re: jMeter HTTP POST query

Hi

At first I thought this wasn't currently possible.
But when I saw that you were using a file with curl, I remembered how 
the HTTP Post code works, and I think it is possible to do.

If you put the "post body" you want to send in a file, and then 
reference the filename in the "Filename" field HTTP Request GUI, and not 
specify any value for "Mimetype" nor "Value for "name" attribute",
then the HTTP Post code will send the file content as the only content 
of the post body.

I think that will work as you expect. If it does not work with Jmeter 
2.2, I suggest you try with the latest nightly build, since I have 
changed the HTTP Post handling in Jmeter a bit lately,
but I am not sure if you need the changes I have made, I don't remember 
exactly.

Note that this discussion is a bit similar to the discussion going on 
under the subject "$HTTP_RAW_POST_DATA" on this mailing list.

Regards
Alf Hogemark

Thomson, Alex wrote:
> All,
>
>  
>
> I have just started using jMeter v2.2 and am encountering an issue.
>
>  
>
> I have been using curl to send the following style of HTTP POST to the
> system under test:
>
>  
>
> $ curl -data-binary @/example/file.xml
> http://localhost:1234/example/path
>
>  
>
> (Wireshark packet capture)
>
>  
>
> Hypertext Transfer Protocol
>
>     POST /example/path HTTP/1.1\r\n
>
>         Request Method: POST
>
>         Request URI: /example/path
>
>         Request Version: HTTP/1.1
>
>     User-Agent: curl/7.12.1 (i386-redhat-linux-gnu) libcurl/7.12.1
> OpenSSL/0.9.7a zlib/1.2.1.2 libidn/0.5.6\r\n
>
>     Host: localhost:8080\r\n
>
>     Pragma: no-cache\r\n
>
>     Accept: */*\r\n
>
>     Content-Length: 6190
>
>     Content-Type: application/x-www-form-urlencoded\r\n
>
>     \r\n
>
> Line-based text data: application/x-www-form-urlencoded
>
>     <!DOCTYPE EXAMPLE SYSTEM "C:\EXAMPLE.dtd">\r\n
>
>     <Doc>\r\n
>
>       <Asset>\r\n
>
>         <Tag Place="Wonderland" Person="Alice" />\r\n
>
>       </Asset>\r\n
>
>     </Doc>
>
>  
>
> Is it possible to send this format of HTTP POST using jMeter? It only
> seems to support multipart-form POSTs.
>
>  
>
> Thanks,
>
>  
>
> Alex Thomson
>
>  
>
> This email message and any attachments thereto are intended only for use by 
> the addressee(s) named above, and may contain legally privileged and/or 
> confidential information. If the reader of this message is not the intended 
> recipient, or the employee or agent responsible to deliver it to the intended 
> recipient, you are hereby notified that any dissemination, distribution or 
> copying of this communication is strictly prohibited. If you have received 
> this communication in error, please immediately notify the [EMAIL PROTECTED] 
> and destroy the original message
> This email message and any attachments thereto are intended only for use by 
> the addressee(s) named above, and may contain legally privileged and/or 
> confidential information. If the reader of this message is not the intended 
> recipient, or the employee or agent responsible to deliver it to the intended 
> recipient, you are hereby notified that any dissemination, distribution or 
> copying of this communication is strictly prohibited. If you have received 
> this communication in error, please immediately notify the [EMAIL PROTECTED] 
> and destroy the original message.
>
> NDS Limited   Registered office: One Heathrow Boulevard, 286 Bath Road, West 
> Drayton, Middlesex, UB7 0DQ, United Kingdom
> A company registered in England and Wales   Registered no. 3080780    VAT no. 
> GB 603 8808 40-00
>
>
>   

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

This email message and any attachments thereto are intended only for use by the 
addressee(s) named above, and may contain legally privileged and/or 
confidential information. If the reader of this message is not the intended 
recipient, or the employee or agent responsible to deliver it to the intended 
recipient, you are hereby notified that any dissemination, distribution or 
copying of this communication is strictly prohibited. If you have received this 
communication in error, please immediately notify the [EMAIL PROTECTED] and 
destroy the original message
This email message and any attachments thereto are intended only for use by the 
addressee(s) named above, and may contain legally privileged and/or 
confidential information. If the reader of this message is not the intended 
recipient, or the employee or agent responsible to deliver it to the intended 
recipient, you are hereby notified that any dissemination, distribution or 
copying of this communication is strictly prohibited. If you have received this 
communication in error, please immediately notify the [EMAIL PROTECTED] and 
destroy the original message.

NDS Limited   Registered office: One Heathrow Boulevard, 286 Bath Road, West 
Drayton, Middlesex, UB7 0DQ, United Kingdom
A company registered in England and Wales   Registered no. 3080780    VAT no. 
GB 603 8808 40-00


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

***********************************************************************************
Information contained in this email message is confidential and may be 
privileged, and is intended only for use of the individual or entity named 
above. If the reader of this message is not the intended recipient, or the 
employee or agent responsible to deliver it to the intended recipient, you are 
hereby notified that any dissemination, distribution or copying of this 
communication is strictly prohibited. If you have received this communication 
in error, please immediately notify the [EMAIL PROTECTED] and destroy the 
original message.
***********************************************************************************
 
This email message and any attachments thereto are intended only for use by the 
addressee(s) named above, and may contain legally privileged and/or 
confidential information. If the reader of this message is not the intended 
recipient, or the employee or agent responsible to deliver it to the intended 
recipient, you are hereby notified that any dissemination, distribution or 
copying of this communication is strictly prohibited. If you have received this 
communication in error, please immediately notify the [EMAIL PROTECTED] and 
destroy the original message
This email message and any attachments thereto are intended only for use by the 
addressee(s) named above, and may contain legally privileged and/or 
confidential information. If the reader of this message is not the intended 
recipient, or the employee or agent responsible to deliver it to the intended 
recipient, you are hereby notified that any dissemination, distribution or 
copying of this communication is strictly prohibited. If you have received this 
communication in error, please immediately notify the [EMAIL PROTECTED] and 
destroy the original message.

NDS Limited   Registered office: One Heathrow Boulevard, 286 Bath Road, West 
Drayton, Middlesex, UB7 0DQ, United Kingdom
A company registered in England and Wales   Registered no. 3080780    VAT no. 
GB 603 8808 40-00


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to