You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by R R <ra...@hotmail.co.uk> on 2006/09/17 18:00:55 UTC

Issue with Header Manager

Hi,

I have a need to put in a custom HTTP request and am hoping to use the HTTP 
Header Manager to do this but I am seeing a odd issue with duplicate 
variable names:

The reqest need to be something like:

>>Request <<

PUT /lisa/calendar/newevent.ics HTTP/1.1
If-None-Match: *
Host: cal.example.com
Content-Type: text/calendar
Content-Length: xxx

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Example Corp.//CalDAV Client//EN
BEGIN:VEVENT
UID:20010712T182145Z-123401@example.com
DTSTART:20010714T170000Z
DTEND:20010715T035959Z
SUMMARY:Bastille Day Party
END:VEVENT
END:VCALENDAR


But when I put these values into the HTTP Header Manager there is a 
difference with with what Jmeter thinks its sending and what is actualy 
sent. In the sample request listener everything looks ok but by using 
Etherial I can see that when a variable is duplicated only the 2nd value is 
used.

So the above header actulay shows up as...

PUT /lisa/calendar/newevent.ics HTTP/1.1

Host: caldavlinux.oracle.com
If-None-Match: *
Content-Type: text/calendar
BEGIN: VEVENT
VERSION: 2.0
PRODID: -//Example Corp.//CalDAV Client//EN
UID:20010712T182145Z-123401@example.com
DTSTAMP: 20060712T182145Z
DTSTART: 20060714T170000Z
DTEND: 20060715T040000Z
SUMMARY: Bastille Day Party
END: VCALENDAR
Authorization: Basic cmV6YS5yb2tuaUBvcmFjbGUuY29tOnRlc3Qx
User-Agent: Java/1.5.0_07
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2

As can be seen the BEGIN and END values are only getting picked up for the 
2nd occurance of the value in the JMX file.

Is there a known issue with this with any workarounds?

Cheers

R

_________________________________________________________________
Windows Live™ Messenger has arrived. Click here to download it for free! 
http://imagine-msn.com/messenger/launch80/?locale=en-gb


---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Issue with Header Manager

Posted by R R <ra...@hotmail.co.uk>.
Hi,

I picked the SOAP sampler as the GUI was a lot easier for my little Java 
brain to understand...

But I will give it a bash with the Http sampler... The worst that can happen 
is that it will go boom :)

R


>From: sebb <se...@gmail.com>
>Reply-To: "JMeter Users List" <jm...@jakarta.apache.org>
>To: "JMeter Users List" <jm...@jakarta.apache.org>
>Subject: Re: Issue with Header Manager
>Date: Mon, 18 Sep 2006 11:11:07 +0100
>
>On 18/09/06, R R <ra...@hotmail.co.uk> wrote:
>>Hi,
>>
>>Was just thinking of a simple way around this I thought the following
>>customisation maybe straightforward for me to try out…
>>
>>Use the SOAP sampler and change the POST call to a PUT call and make it 
>>use
>>the Authorization Manager (the site needs Basic Authentication).
>>
>>Does this look like a reasonable approach?
>
>Since the HTTP Samplers support PUT, why not use that as a base instead?
>
>Otherwise, unless there are a lot of different combinations of files,
>I think I would create the different samples with suitable names, and
>use the file name.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>

_________________________________________________________________
Windows Live™ Messenger has arrived. Click here to download it for free! 
http://imagine-msn.com/messenger/launch80/?locale=en-gb


---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Issue with Header Manager

Posted by sebb <se...@gmail.com>.
On 18/09/06, R R <ra...@hotmail.co.uk> wrote:
> Hi,
>
> Was just thinking of a simple way around this I thought the following
> customisation maybe straightforward for me to try out…
>
> Use the SOAP sampler and change the POST call to a PUT call and make it use
> the Authorization Manager (the site needs Basic Authentication).
>
> Does this look like a reasonable approach?

Since the HTTP Samplers support PUT, why not use that as a base instead?

Otherwise, unless there are a lot of different combinations of files,
I think I would create the different samples with suitable names, and
use the file name.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Issue with Header Manager

Posted by R R <ra...@hotmail.co.uk>.
Hi,

Was just thinking of a simple way around this I thought the following 
customisation maybe straightforward for me to try out…

Use the SOAP sampler and change the POST call to a PUT call and make it use 
the Authorization Manager (the site needs Basic Authentication).

Does this look like a reasonable approach?

Cheers

R
,


>From: sebb <se...@gmail.com>
>Reply-To: "JMeter Users List" <jm...@jakarta.apache.org>
>To: "JMeter Users List" <jm...@jakarta.apache.org>
>Subject: Re: Issue with Header Manager
>Date: Sun, 17 Sep 2006 22:48:49 +0100
>
>On 17/09/06, R R <ra...@hotmail.co.uk> wrote:
>>Hi,
>>
>>Yes you are correct this is part of the body. I was using the Header's as 
>>I
>>could not see how to alter the body message on the http request.
>>
>>If I use the param values it gets placed as part of the URL before the
>>If-None-Match value.
>
>Depends:
>
>If you use GET, then parameters are always included as part of the URL
>- there is no body.
>
>For POST, parameters are sent as part of the body, in the form:
>
>p1=val1&p2=val2&...
>
>>Am I missing the obvious and there is a way to change
>>the content of the body being sent with the HTTP sampler?
>
>No, at present the only way to send any content is to provide a file,
>and there is no substitution of file contents.
>
>There are no immediate plans to provide this facility.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>

_________________________________________________________________
Be the first to hear what's new at MSN - sign up to our free newsletters! 
http://www.msn.co.uk/newsletters


---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Issue with Header Manager

Posted by sebb <se...@gmail.com>.
On 17/09/06, R R <ra...@hotmail.co.uk> wrote:
> Hi,
>
> Yes you are correct this is part of the body. I was using the Header's as I
> could not see how to alter the body message on the http request.
>
> If I use the param values it gets placed as part of the URL before the
> If-None-Match value.

Depends:

If you use GET, then parameters are always included as part of the URL
- there is no body.

For POST, parameters are sent as part of the body, in the form:

p1=val1&p2=val2&...

> Am I missing the obvious and there is a way to change
> the content of the body being sent with the HTTP sampler?

No, at present the only way to send any content is to provide a file,
and there is no substitution of file contents.

There are no immediate plans to provide this facility.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Issue with Header Manager

Posted by R R <ra...@hotmail.co.uk>.
Hi,

Yes you are correct this is part of the body. I was using the Header's as I 
could not see how to alter the body message on the http request.

If I use the param values it gets placed as part of the URL before the 
If-None-Match value. Am I missing the obvious and there is a way to change 
the content of the body being sent with the HTTP sampler?

Thanx

R


>From: sebb <se...@gmail.com>
>Reply-To: "JMeter Users List" <jm...@jakarta.apache.org>
>To: "JMeter Users List" <jm...@jakarta.apache.org>
>Subject: Re: Issue with Header Manager
>Date: Sun, 17 Sep 2006 17:54:17 +0100
>
>On 17/09/06, R R <ra...@hotmail.co.uk> wrote:
>>Hi,
>>
>>I have a need to put in a custom HTTP request and am hoping to use the 
>>HTTP
>>Header Manager to do this but I am seeing a odd issue with duplicate
>>variable names:
>>
>>The reqest need to be something like:
>>
>> >>Request <<
>>
>>PUT /lisa/calendar/newevent.ics HTTP/1.1
>>If-None-Match: *
>>Host: cal.example.com
>>Content-Type: text/calendar
>>Content-Length: xxx
>>
>>BEGIN:VCALENDAR
>>VERSION:2.0
>>PRODID:-//Example Corp.//CalDAV Client//EN
>>BEGIN:VEVENT
>>UID:20010712T182145Z-123401@example.com
>>DTSTART:20010714T170000Z
>>DTEND:20010715T035959Z
>>SUMMARY:Bastille Day Party
>>END:VEVENT
>>END:VCALENDAR
>
>These are body content, not headers, surely?
>
>>But when I put these values into the HTTP Header Manager there is a
>>difference with with what Jmeter thinks its sending and what is actualy
>>sent. In the sample request listener everything looks ok but by using
>>Etherial I can see that when a variable is duplicated only the 2nd value 
>>is
>>used.
>
>This is due to the Http implementation, not JMeter. The stand Http
>Sampler uses the following method:
>
>void java.net.URLConnection.setRequestProperty(String key, String value)
>
>For which the Javadoc says:
>
>>>
>Sets the general request property. If a property with the key already
>exists, overwrite its value with the new value.
>
>NOTE: HTTP requires all request properties which can legally have
>multiple instances with the same key to use a comma-seperated list
>syntax which enables multiple properties to be appended into a single
>property.
><<
>
>>So the above header actulay shows up as...
>>
>>PUT /lisa/calendar/newevent.ics HTTP/1.1
>>
>>Host: caldavlinux.oracle.com
>>If-None-Match: *
>>Content-Type: text/calendar
>>BEGIN: VEVENT
>>VERSION: 2.0
>>PRODID: -//Example Corp.//CalDAV Client//EN
>>UID:20010712T182145Z-123401@example.com
>>DTSTAMP: 20060712T182145Z
>>DTSTART: 20060714T170000Z
>>DTEND: 20060715T040000Z
>>SUMMARY: Bastille Day Party
>>END: VCALENDAR
>>Authorization: Basic cmV6YS5yb2tuaUBvcmFjbGUuY29tOnRlc3Qx
>>User-Agent: Java/1.5.0_07
>>Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
>>
>>As can be seen the BEGIN and END values are only getting picked up for the
>>2nd occurance of the value in the JMX file.
>>
>>Is there a known issue with this with any workarounds?
>
>This is working as documented.
>
>As far as I can tell, the VCard data should be sent as part of the
>BODY, not headers.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>

_________________________________________________________________
Windows Live™ Messenger has arrived. Click here to download it for free! 
http://imagine-msn.com/messenger/launch80/?locale=en-gb


---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Issue with Header Manager

Posted by sebb <se...@gmail.com>.
On 17/09/06, R R <ra...@hotmail.co.uk> wrote:
> Hi,
>
> I have a need to put in a custom HTTP request and am hoping to use the HTTP
> Header Manager to do this but I am seeing a odd issue with duplicate
> variable names:
>
> The reqest need to be something like:
>
> >>Request <<
>
> PUT /lisa/calendar/newevent.ics HTTP/1.1
> If-None-Match: *
> Host: cal.example.com
> Content-Type: text/calendar
> Content-Length: xxx
>
> BEGIN:VCALENDAR
> VERSION:2.0
> PRODID:-//Example Corp.//CalDAV Client//EN
> BEGIN:VEVENT
> UID:20010712T182145Z-123401@example.com
> DTSTART:20010714T170000Z
> DTEND:20010715T035959Z
> SUMMARY:Bastille Day Party
> END:VEVENT
> END:VCALENDAR

These are body content, not headers, surely?

> But when I put these values into the HTTP Header Manager there is a
> difference with with what Jmeter thinks its sending and what is actualy
> sent. In the sample request listener everything looks ok but by using
> Etherial I can see that when a variable is duplicated only the 2nd value is
> used.

This is due to the Http implementation, not JMeter. The stand Http
Sampler uses the following method:

void java.net.URLConnection.setRequestProperty(String key, String value)

For which the Javadoc says:

>>
Sets the general request property. If a property with the key already
exists, overwrite its value with the new value.

NOTE: HTTP requires all request properties which can legally have
multiple instances with the same key to use a comma-seperated list
syntax which enables multiple properties to be appended into a single
property.
<<

> So the above header actulay shows up as...
>
> PUT /lisa/calendar/newevent.ics HTTP/1.1
>
> Host: caldavlinux.oracle.com
> If-None-Match: *
> Content-Type: text/calendar
> BEGIN: VEVENT
> VERSION: 2.0
> PRODID: -//Example Corp.//CalDAV Client//EN
> UID:20010712T182145Z-123401@example.com
> DTSTAMP: 20060712T182145Z
> DTSTART: 20060714T170000Z
> DTEND: 20060715T040000Z
> SUMMARY: Bastille Day Party
> END: VCALENDAR
> Authorization: Basic cmV6YS5yb2tuaUBvcmFjbGUuY29tOnRlc3Qx
> User-Agent: Java/1.5.0_07
> Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
>
> As can be seen the BEGIN and END values are only getting picked up for the
> 2nd occurance of the value in the JMX file.
>
> Is there a known issue with this with any workarounds?

This is working as documented.

As far as I can tell, the VCard data should be sent as part of the
BODY, not headers.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org