Hi

You should use the same filel as you are using when testing with curl.
You should then reference that file from the "HTTP Request GUI", like
I tried to suggest.
I've attached a testplan I made.

The nightly builds can be downloaded from :
http://people.apache.org/builds/jakarta-jmeter/nightly/

I've tried with the latest nightly build, which also displays more
nicely what is actually sent in the "Request" tab of the "View
Results Tree" listener.
Unfortunately, I do not have the wireshark installed on my computer.
But by looking at "View Results Tree", I think that the test plan I
have attached works as you expect, when running the lastest nightly
build.

Let us know what you find out.


Regards
Alf

---- Opprinnelig melding ----
Fra: [EMAIL PROTECTED]
Til: [EMAIL PROTECTED]
Emne: RE: jMeter HTTP POST query
Dato: Thu, 12 Apr 2007 09:08:53 +0100

>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]

<!DOCTYPE EXAMPLE SYSTEM "C:\EXAMPLE.dtd">
<Doc>
<Asset>
<Tag Place="Wonderland" Person="Alice" />
</Asset>
</Doc>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to