You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by "Phan, Van" <tp...@ebay.com> on 2010/06/14 22:08:58 UTC

Problem w/ json in https request

Hi,
Please help. Thanks in advance.
I want to send a https request w/ json format, and parse json response.
I set up a Thread Group that has HTTP Request Default.
I have HTTP Request which has (json request in parameter value, parameter name is blank,  and HTTP Header
has "Content-Type=application/json", and View result tree listener  to get  response.  I got the request sent out as no Jason attached. Looking at Exact JSON should be in param.value:

{"cid":"lsakdjflsa", "pst":"lskajdflsa", "context":{"country":"default","language":"default","view":"default","container":"default"},"gadgets":[{"gid":"1111","moduleId":1}]}

View Result Tree shows the request has this only ...

>>>>GET https://localhost:22108/gadgets/metadata

[no cookies]

Request Headers:
Connection: keep-alive
Content-Type: application/json
>>>>>>

Below is sampler, RED is highlight the Jason as Param Value.

 Sample of HTTPSampler:

       <HTTPSampler guiclass="HttpTestSampleGui" testclass="HTTPSampler" testname="/gadgets/metadata" enabled="true">
          <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
            <collectionProp name="Arguments.arguments">
              <elementProp name="" elementType="HTTPArgument">
                <boolProp name="HTTPArgument.always_encode">true</boolProp>
                <stringProp name="Argument.value">{&quot;cid&quot;:&quot;lsakdjflsa&quot;, &quot;pst&quot;:&quot;lskajdflsa&quot;, &quot;context&quot;:{&quot;country&quot;:&quot;default&quot;,&quot;language&quot;:&quot;default&quot;,&quot;view&quot;:&quot;default&quot;,&quot;container&quot;:&quot;default&quot;},&quot;gadgets&quot;:[{&quot;gid&quot;:&quot;1111&quot;,&quot;moduleId&quot;:1}]}</stringProp>
                <stringProp name="Argument.metadata">=</stringProp>
                <boolProp name="HTTPArgument.use_equals">true</boolProp>
              </elementProp>
            </collectionProp>
          </elementProp>
          <stringProp name="HTTPSampler.domain">localhost</stringProp>
          <stringProp name="HTTPSampler.port">22108</stringProp>
          <stringProp name="HTTPSampler.protocol">https</stringProp>
          <stringProp name="HTTPSampler.contentEncoding"></stringProp>
          <stringProp name="HTTPSampler.path">/gadgets/metadata</stringProp>
          <stringProp name="HTTPSampler.method">GET</stringProp>
          <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
          <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
          <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
          <boolProp name="HTTPSampler.DO_MULTIPART_POST">true</boolProp>
          <stringProp name="HTTPSampler.mimetype"></stringProp>
          <stringProp name="HTTPSampler.FILE_NAME"></stringProp>
          <stringProp name="HTTPSampler.FILE_FIELD"></stringProp>
          <stringProp name="HTTPSampler.monitor">false</stringProp>
          <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
        </HTTPSampler>
        <hashTree/>

Thanks a lot.
Van

RE: Problem w/ json in https request

Posted by "Phan, Van" <tp...@ebay.com>.
I meant response data, it's empty. I ran from cmd line curl, and I got the resp back fine.
Not sure why cannot get in jmeter.
Thx.
van

-----Original Message-----
From: Phan, Van [mailto:tphan@ebay.com] 
Sent: Monday, June 14, 2010 2:28 PM
To: JMeter Users List
Subject: RE: Problem w/ json in https request

Thank you Deepak.
Yes, I have to change it to PUT to get 200 success code back. 
However, the response in View Result Tree, is empty.
How could I the actual response in RESPONSE tab?
Thanks a lot for your help.

Van

-----Original Message-----
From: Deepak Shetty [mailto:shettyd@gmail.com] 
Sent: Monday, June 14, 2010 2:00 PM
To: JMeter Users List
Subject: Re: Problem w/ json in https request

Just to confirm
http://jakarta.apache.org/jmeter/usermanual/component_reference.html#HTTP_Request

For the POST and PUT method, if there is no file to send, and the name(s) of
the parameter(s) are omitted, then the body is created by concatenating all
the value(s) of the parameters. ...

For other methods, if the name of the parameter is missing, then the
parameter is ignored.

So if you have an empty name , the Method cant be GET

regards
deepak



On Mon, Jun 14, 2010 at 1:46 PM, Deepak Shetty <sh...@gmail.com> wrote:

> Hi
> I believe you have to use POST (or PUT) (if you wish to specify empty
> parameter name in JMeter). If you want to use GET , youll have to directly
> specify this in URL.
>
> regards
> deepak
>
>
> On Mon, Jun 14, 2010 at 1:08 PM, Phan, Van <tp...@ebay.com> wrote:
>
>> Hi,
>> Please help. Thanks in advance.
>> I want to send a https request w/ json format, and parse json response.
>> I set up a Thread Group that has HTTP Request Default.
>> I have HTTP Request which has (json request in parameter value, parameter
>> name is blank,  and HTTP Header
>> has "Content-Type=application/json", and View result tree listener  to get
>>  response.  I got the request sent out as no Jason attached. Looking at
>> Exact JSON should be in param.value:
>>
>> {"cid":"lsakdjflsa", "pst":"lskajdflsa",
>> "context":{"country":"default","language":"default","view":"default","container":"default"},"gadgets":[{"gid":"1111","moduleId":1}]}
>>
>> View Result Tree shows the request has this only ...
>>
>> >>>>GET https://localhost:22108/gadgets/metadata
>>
>> [no cookies]
>>
>> Request Headers:
>> Connection: keep-alive
>> Content-Type: application/json
>> >>>>>>
>>
>> Below is sampler, RED is highlight the Jason as Param Value.
>>
>>  Sample of HTTPSampler:
>>
>>       <HTTPSampler guiclass="HttpTestSampleGui" testclass="HTTPSampler"
>> testname="/gadgets/metadata" enabled="true">
>>          <elementProp name="HTTPsampler.Arguments" elementType="Arguments"
>> guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
>>            <collectionProp name="Arguments.arguments">
>>              <elementProp name="" elementType="HTTPArgument">
>>                <boolProp name="HTTPArgument.always_encode">true</boolProp>
>>                <stringProp
>> name="Argument.value">{&quot;cid&quot;:&quot;lsakdjflsa&quot;,
>> &quot;pst&quot;:&quot;lskajdflsa&quot;,
>> &quot;context&quot;:{&quot;country&quot;:&quot;default&quot;,&quot;language&quot;:&quot;default&quot;,&quot;view&quot;:&quot;default&quot;,&quot;container&quot;:&quot;default&quot;},&quot;gadgets&quot;:[{&quot;gid&quot;:&quot;1111&quot;,&quot;moduleId&quot;:1}]}</stringProp>
>>                <stringProp name="Argument.metadata">=</stringProp>
>>                <boolProp name="HTTPArgument.use_equals">true</boolProp>
>>              </elementProp>
>>            </collectionProp>
>>          </elementProp>
>>          <stringProp name="HTTPSampler.domain">localhost</stringProp>
>>          <stringProp name="HTTPSampler.port">22108</stringProp>
>>          <stringProp name="HTTPSampler.protocol">https</stringProp>
>>          <stringProp name="HTTPSampler.contentEncoding"></stringProp>
>>          <stringProp
>> name="HTTPSampler.path">/gadgets/metadata</stringProp>
>>          <stringProp name="HTTPSampler.method">GET</stringProp>
>>          <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
>>          <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
>>          <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
>>          <boolProp name="HTTPSampler.DO_MULTIPART_POST">true</boolProp>
>>          <stringProp name="HTTPSampler.mimetype"></stringProp>
>>          <stringProp name="HTTPSampler.FILE_NAME"></stringProp>
>>          <stringProp name="HTTPSampler.FILE_FIELD"></stringProp>
>>          <stringProp name="HTTPSampler.monitor">false</stringProp>
>>          <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
>>        </HTTPSampler>
>>        <hashTree/>
>>
>> Thanks a lot.
>> Van
>>
>
>

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


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


Re: Problem w/ json in https request

Posted by Deepak Shetty <sh...@gmail.com>.
Ok for PUT.
It isnt the same request(otherwise it would work). like I said compare it at
an HTTP level and you should be able to figure out the difference

regards
deepak

On Mon, Jun 14, 2010 at 2:59 PM, Phan, Van <tp...@ebay.com> wrote:

> I have to use PUT to get success 200. Using POST, I get bad request.
> I test the application, using curl cmd w/ the same json to test, I got the
> Json success response back.
> It's just in jmeter, response data is empty.
>
> Van
> -----Original Message-----
> From: Deepak Shetty [mailto:shettyd@gmail.com]
> Sent: Monday, June 14, 2010 2:36 PM
> To: JMeter Users List
> Subject: Re: Problem w/ json in https request
>
> Hi
> use POST , not PUT.
> The response tab is what your application responds with (Im assuming you
> have it as Show Text). If it isnt giving you what you expect , then
> possibly
> we are not sending the data to it correctly(assuming the app works
> correctly). if you have access to the app logs then this is easy to figure
> out , if not then you need to compare with any working request
>
>
> regards
> deepak
>
> On Mon, Jun 14, 2010 at 2:28 PM, Phan, Van <tp...@ebay.com> wrote:
>
> > Thank you Deepak.
> > Yes, I have to change it to PUT to get 200 success code back.
> > However, the response in View Result Tree, is empty.
> > How could I the actual response in RESPONSE tab?
> > Thanks a lot for your help.
> >
> > Van
> >
> > -----Original Message-----
> > From: Deepak Shetty [mailto:shettyd@gmail.com]
> > Sent: Monday, June 14, 2010 2:00 PM
> > To: JMeter Users List
> > Subject: Re: Problem w/ json in https request
> >
> > Just to confirm
> >
> >
> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#HTTP_Request
> >
> > For the POST and PUT method, if there is no file to send, and the name(s)
> > of
> > the parameter(s) are omitted, then the body is created by concatenating
> all
> > the value(s) of the parameters. ...
> >
> > For other methods, if the name of the parameter is missing, then the
> > parameter is ignored.
> >
> > So if you have an empty name , the Method cant be GET
> >
> > regards
> > deepak
> >
> >
> >
> > On Mon, Jun 14, 2010 at 1:46 PM, Deepak Shetty <sh...@gmail.com>
> wrote:
> >
> > > Hi
> > > I believe you have to use POST (or PUT) (if you wish to specify empty
> > > parameter name in JMeter). If you want to use GET , youll have to
> > directly
> > > specify this in URL.
> > >
> > > regards
> > > deepak
> > >
> > >
> > > On Mon, Jun 14, 2010 at 1:08 PM, Phan, Van <tp...@ebay.com> wrote:
> > >
> > >> Hi,
> > >> Please help. Thanks in advance.
> > >> I want to send a https request w/ json format, and parse json
> response.
> > >> I set up a Thread Group that has HTTP Request Default.
> > >> I have HTTP Request which has (json request in parameter value,
> > parameter
> > >> name is blank,  and HTTP Header
> > >> has "Content-Type=application/json", and View result tree listener  to
> > get
> > >>  response.  I got the request sent out as no Jason attached. Looking
> at
> > >> Exact JSON should be in param.value:
> > >>
> > >> {"cid":"lsakdjflsa", "pst":"lskajdflsa",
> > >>
> >
> "context":{"country":"default","language":"default","view":"default","container":"default"},"gadgets":[{"gid":"1111","moduleId":1}]}
> > >>
> > >> View Result Tree shows the request has this only ...
> > >>
> > >> >>>>GET https://localhost:22108/gadgets/metadata
> > >>
> > >> [no cookies]
> > >>
> > >> Request Headers:
> > >> Connection: keep-alive
> > >> Content-Type: application/json
> > >> >>>>>>
> > >>
> > >> Below is sampler, RED is highlight the Jason as Param Value.
> > >>
> > >>  Sample of HTTPSampler:
> > >>
> > >>       <HTTPSampler guiclass="HttpTestSampleGui"
> testclass="HTTPSampler"
> > >> testname="/gadgets/metadata" enabled="true">
> > >>          <elementProp name="HTTPsampler.Arguments"
> > elementType="Arguments"
> > >> guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
> > >>            <collectionProp name="Arguments.arguments">
> > >>              <elementProp name="" elementType="HTTPArgument">
> > >>                <boolProp
> > name="HTTPArgument.always_encode">true</boolProp>
> > >>                <stringProp
> > >> name="Argument.value">{&quot;cid&quot;:&quot;lsakdjflsa&quot;,
> > >> &quot;pst&quot;:&quot;lskajdflsa&quot;,
> > >>
> >
> &quot;context&quot;:{&quot;country&quot;:&quot;default&quot;,&quot;language&quot;:&quot;default&quot;,&quot;view&quot;:&quot;default&quot;,&quot;container&quot;:&quot;default&quot;},&quot;gadgets&quot;:[{&quot;gid&quot;:&quot;1111&quot;,&quot;moduleId&quot;:1}]}</stringProp>
> > >>                <stringProp name="Argument.metadata">=</stringProp>
> > >>                <boolProp
> name="HTTPArgument.use_equals">true</boolProp>
> > >>              </elementProp>
> > >>            </collectionProp>
> > >>          </elementProp>
> > >>          <stringProp name="HTTPSampler.domain">localhost</stringProp>
> > >>          <stringProp name="HTTPSampler.port">22108</stringProp>
> > >>          <stringProp name="HTTPSampler.protocol">https</stringProp>
> > >>          <stringProp name="HTTPSampler.contentEncoding"></stringProp>
> > >>          <stringProp
> > >> name="HTTPSampler.path">/gadgets/metadata</stringProp>
> > >>          <stringProp name="HTTPSampler.method">GET</stringProp>
> > >>          <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
> > >>          <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
> > >>          <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
> > >>          <boolProp
> name="HTTPSampler.DO_MULTIPART_POST">true</boolProp>
> > >>          <stringProp name="HTTPSampler.mimetype"></stringProp>
> > >>          <stringProp name="HTTPSampler.FILE_NAME"></stringProp>
> > >>          <stringProp name="HTTPSampler.FILE_FIELD"></stringProp>
> > >>          <stringProp name="HTTPSampler.monitor">false</stringProp>
> > >>          <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
> > >>        </HTTPSampler>
> > >>        <hashTree/>
> > >>
> > >> Thanks a lot.
> > >> Van
> > >>
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

RE: Problem w/ json in https request

Posted by "Phan, Van" <tp...@ebay.com>.
I have to use PUT to get success 200. Using POST, I get bad request.
I test the application, using curl cmd w/ the same json to test, I got the Json success response back.
It's just in jmeter, response data is empty.

Van
-----Original Message-----
From: Deepak Shetty [mailto:shettyd@gmail.com] 
Sent: Monday, June 14, 2010 2:36 PM
To: JMeter Users List
Subject: Re: Problem w/ json in https request

Hi
use POST , not PUT.
The response tab is what your application responds with (Im assuming you
have it as Show Text). If it isnt giving you what you expect , then possibly
we are not sending the data to it correctly(assuming the app works
correctly). if you have access to the app logs then this is easy to figure
out , if not then you need to compare with any working request


regards
deepak

On Mon, Jun 14, 2010 at 2:28 PM, Phan, Van <tp...@ebay.com> wrote:

> Thank you Deepak.
> Yes, I have to change it to PUT to get 200 success code back.
> However, the response in View Result Tree, is empty.
> How could I the actual response in RESPONSE tab?
> Thanks a lot for your help.
>
> Van
>
> -----Original Message-----
> From: Deepak Shetty [mailto:shettyd@gmail.com]
> Sent: Monday, June 14, 2010 2:00 PM
> To: JMeter Users List
> Subject: Re: Problem w/ json in https request
>
> Just to confirm
>
> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#HTTP_Request
>
> For the POST and PUT method, if there is no file to send, and the name(s)
> of
> the parameter(s) are omitted, then the body is created by concatenating all
> the value(s) of the parameters. ...
>
> For other methods, if the name of the parameter is missing, then the
> parameter is ignored.
>
> So if you have an empty name , the Method cant be GET
>
> regards
> deepak
>
>
>
> On Mon, Jun 14, 2010 at 1:46 PM, Deepak Shetty <sh...@gmail.com> wrote:
>
> > Hi
> > I believe you have to use POST (or PUT) (if you wish to specify empty
> > parameter name in JMeter). If you want to use GET , youll have to
> directly
> > specify this in URL.
> >
> > regards
> > deepak
> >
> >
> > On Mon, Jun 14, 2010 at 1:08 PM, Phan, Van <tp...@ebay.com> wrote:
> >
> >> Hi,
> >> Please help. Thanks in advance.
> >> I want to send a https request w/ json format, and parse json response.
> >> I set up a Thread Group that has HTTP Request Default.
> >> I have HTTP Request which has (json request in parameter value,
> parameter
> >> name is blank,  and HTTP Header
> >> has "Content-Type=application/json", and View result tree listener  to
> get
> >>  response.  I got the request sent out as no Jason attached. Looking at
> >> Exact JSON should be in param.value:
> >>
> >> {"cid":"lsakdjflsa", "pst":"lskajdflsa",
> >>
> "context":{"country":"default","language":"default","view":"default","container":"default"},"gadgets":[{"gid":"1111","moduleId":1}]}
> >>
> >> View Result Tree shows the request has this only ...
> >>
> >> >>>>GET https://localhost:22108/gadgets/metadata
> >>
> >> [no cookies]
> >>
> >> Request Headers:
> >> Connection: keep-alive
> >> Content-Type: application/json
> >> >>>>>>
> >>
> >> Below is sampler, RED is highlight the Jason as Param Value.
> >>
> >>  Sample of HTTPSampler:
> >>
> >>       <HTTPSampler guiclass="HttpTestSampleGui" testclass="HTTPSampler"
> >> testname="/gadgets/metadata" enabled="true">
> >>          <elementProp name="HTTPsampler.Arguments"
> elementType="Arguments"
> >> guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
> >>            <collectionProp name="Arguments.arguments">
> >>              <elementProp name="" elementType="HTTPArgument">
> >>                <boolProp
> name="HTTPArgument.always_encode">true</boolProp>
> >>                <stringProp
> >> name="Argument.value">{&quot;cid&quot;:&quot;lsakdjflsa&quot;,
> >> &quot;pst&quot;:&quot;lskajdflsa&quot;,
> >>
> &quot;context&quot;:{&quot;country&quot;:&quot;default&quot;,&quot;language&quot;:&quot;default&quot;,&quot;view&quot;:&quot;default&quot;,&quot;container&quot;:&quot;default&quot;},&quot;gadgets&quot;:[{&quot;gid&quot;:&quot;1111&quot;,&quot;moduleId&quot;:1}]}</stringProp>
> >>                <stringProp name="Argument.metadata">=</stringProp>
> >>                <boolProp name="HTTPArgument.use_equals">true</boolProp>
> >>              </elementProp>
> >>            </collectionProp>
> >>          </elementProp>
> >>          <stringProp name="HTTPSampler.domain">localhost</stringProp>
> >>          <stringProp name="HTTPSampler.port">22108</stringProp>
> >>          <stringProp name="HTTPSampler.protocol">https</stringProp>
> >>          <stringProp name="HTTPSampler.contentEncoding"></stringProp>
> >>          <stringProp
> >> name="HTTPSampler.path">/gadgets/metadata</stringProp>
> >>          <stringProp name="HTTPSampler.method">GET</stringProp>
> >>          <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
> >>          <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
> >>          <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
> >>          <boolProp name="HTTPSampler.DO_MULTIPART_POST">true</boolProp>
> >>          <stringProp name="HTTPSampler.mimetype"></stringProp>
> >>          <stringProp name="HTTPSampler.FILE_NAME"></stringProp>
> >>          <stringProp name="HTTPSampler.FILE_FIELD"></stringProp>
> >>          <stringProp name="HTTPSampler.monitor">false</stringProp>
> >>          <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
> >>        </HTTPSampler>
> >>        <hashTree/>
> >>
> >> Thanks a lot.
> >> Van
> >>
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

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


Re: Problem w/ json in https request

Posted by Deepak Shetty <sh...@gmail.com>.
you could upgrade to the latest and see (2.3.4).

On Mon, Jun 14, 2010 at 3:02 PM, Phan, Van <tp...@ebay.com> wrote:

> I have SHOW TEXT selected, however it's gray out, same as RENDER HTML,
> RENDER JSON, RENDER XML.
> Only the check box Download embedded resources is checkable.
>
> Using jmeter 2.3.1
> van
>
> -----Original Message-----
> From: Deepak Shetty [mailto:shettyd@gmail.com]
> Sent: Monday, June 14, 2010 2:36 PM
> To: JMeter Users List
> Subject: Re: Problem w/ json in https request
>
> Hi
> use POST , not PUT.
> The response tab is what your application responds with (Im assuming you
> have it as Show Text). If it isnt giving you what you expect , then
> possibly
> we are not sending the data to it correctly(assuming the app works
> correctly). if you have access to the app logs then this is easy to figure
> out , if not then you need to compare with any working request
>
>
> regards
> deepak
>
> On Mon, Jun 14, 2010 at 2:28 PM, Phan, Van <tp...@ebay.com> wrote:
>
> > Thank you Deepak.
> > Yes, I have to change it to PUT to get 200 success code back.
> > However, the response in View Result Tree, is empty.
> > How could I the actual response in RESPONSE tab?
> > Thanks a lot for your help.
> >
> > Van
> >
> > -----Original Message-----
> > From: Deepak Shetty [mailto:shettyd@gmail.com]
> > Sent: Monday, June 14, 2010 2:00 PM
> > To: JMeter Users List
> > Subject: Re: Problem w/ json in https request
> >
> > Just to confirm
> >
> >
> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#HTTP_Request
> >
> > For the POST and PUT method, if there is no file to send, and the name(s)
> > of
> > the parameter(s) are omitted, then the body is created by concatenating
> all
> > the value(s) of the parameters. ...
> >
> > For other methods, if the name of the parameter is missing, then the
> > parameter is ignored.
> >
> > So if you have an empty name , the Method cant be GET
> >
> > regards
> > deepak
> >
> >
> >
> > On Mon, Jun 14, 2010 at 1:46 PM, Deepak Shetty <sh...@gmail.com>
> wrote:
> >
> > > Hi
> > > I believe you have to use POST (or PUT) (if you wish to specify empty
> > > parameter name in JMeter). If you want to use GET , youll have to
> > directly
> > > specify this in URL.
> > >
> > > regards
> > > deepak
> > >
> > >
> > > On Mon, Jun 14, 2010 at 1:08 PM, Phan, Van <tp...@ebay.com> wrote:
> > >
> > >> Hi,
> > >> Please help. Thanks in advance.
> > >> I want to send a https request w/ json format, and parse json
> response.
> > >> I set up a Thread Group that has HTTP Request Default.
> > >> I have HTTP Request which has (json request in parameter value,
> > parameter
> > >> name is blank,  and HTTP Header
> > >> has "Content-Type=application/json", and View result tree listener  to
> > get
> > >>  response.  I got the request sent out as no Jason attached. Looking
> at
> > >> Exact JSON should be in param.value:
> > >>
> > >> {"cid":"lsakdjflsa", "pst":"lskajdflsa",
> > >>
> >
> "context":{"country":"default","language":"default","view":"default","container":"default"},"gadgets":[{"gid":"1111","moduleId":1}]}
> > >>
> > >> View Result Tree shows the request has this only ...
> > >>
> > >> >>>>GET https://localhost:22108/gadgets/metadata
> > >>
> > >> [no cookies]
> > >>
> > >> Request Headers:
> > >> Connection: keep-alive
> > >> Content-Type: application/json
> > >> >>>>>>
> > >>
> > >> Below is sampler, RED is highlight the Jason as Param Value.
> > >>
> > >>  Sample of HTTPSampler:
> > >>
> > >>       <HTTPSampler guiclass="HttpTestSampleGui"
> testclass="HTTPSampler"
> > >> testname="/gadgets/metadata" enabled="true">
> > >>          <elementProp name="HTTPsampler.Arguments"
> > elementType="Arguments"
> > >> guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
> > >>            <collectionProp name="Arguments.arguments">
> > >>              <elementProp name="" elementType="HTTPArgument">
> > >>                <boolProp
> > name="HTTPArgument.always_encode">true</boolProp>
> > >>                <stringProp
> > >> name="Argument.value">{&quot;cid&quot;:&quot;lsakdjflsa&quot;,
> > >> &quot;pst&quot;:&quot;lskajdflsa&quot;,
> > >>
> >
> &quot;context&quot;:{&quot;country&quot;:&quot;default&quot;,&quot;language&quot;:&quot;default&quot;,&quot;view&quot;:&quot;default&quot;,&quot;container&quot;:&quot;default&quot;},&quot;gadgets&quot;:[{&quot;gid&quot;:&quot;1111&quot;,&quot;moduleId&quot;:1}]}</stringProp>
> > >>                <stringProp name="Argument.metadata">=</stringProp>
> > >>                <boolProp
> name="HTTPArgument.use_equals">true</boolProp>
> > >>              </elementProp>
> > >>            </collectionProp>
> > >>          </elementProp>
> > >>          <stringProp name="HTTPSampler.domain">localhost</stringProp>
> > >>          <stringProp name="HTTPSampler.port">22108</stringProp>
> > >>          <stringProp name="HTTPSampler.protocol">https</stringProp>
> > >>          <stringProp name="HTTPSampler.contentEncoding"></stringProp>
> > >>          <stringProp
> > >> name="HTTPSampler.path">/gadgets/metadata</stringProp>
> > >>          <stringProp name="HTTPSampler.method">GET</stringProp>
> > >>          <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
> > >>          <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
> > >>          <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
> > >>          <boolProp
> name="HTTPSampler.DO_MULTIPART_POST">true</boolProp>
> > >>          <stringProp name="HTTPSampler.mimetype"></stringProp>
> > >>          <stringProp name="HTTPSampler.FILE_NAME"></stringProp>
> > >>          <stringProp name="HTTPSampler.FILE_FIELD"></stringProp>
> > >>          <stringProp name="HTTPSampler.monitor">false</stringProp>
> > >>          <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
> > >>        </HTTPSampler>
> > >>        <hashTree/>
> > >>
> > >> Thanks a lot.
> > >> Van
> > >>
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

RE: Problem w/ json in https request

Posted by "Phan, Van" <tp...@ebay.com>.
I have SHOW TEXT selected, however it's gray out, same as RENDER HTML, RENDER JSON, RENDER XML.
Only the check box Download embedded resources is checkable.

Using jmeter 2.3.1
van

-----Original Message-----
From: Deepak Shetty [mailto:shettyd@gmail.com] 
Sent: Monday, June 14, 2010 2:36 PM
To: JMeter Users List
Subject: Re: Problem w/ json in https request

Hi
use POST , not PUT.
The response tab is what your application responds with (Im assuming you
have it as Show Text). If it isnt giving you what you expect , then possibly
we are not sending the data to it correctly(assuming the app works
correctly). if you have access to the app logs then this is easy to figure
out , if not then you need to compare with any working request


regards
deepak

On Mon, Jun 14, 2010 at 2:28 PM, Phan, Van <tp...@ebay.com> wrote:

> Thank you Deepak.
> Yes, I have to change it to PUT to get 200 success code back.
> However, the response in View Result Tree, is empty.
> How could I the actual response in RESPONSE tab?
> Thanks a lot for your help.
>
> Van
>
> -----Original Message-----
> From: Deepak Shetty [mailto:shettyd@gmail.com]
> Sent: Monday, June 14, 2010 2:00 PM
> To: JMeter Users List
> Subject: Re: Problem w/ json in https request
>
> Just to confirm
>
> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#HTTP_Request
>
> For the POST and PUT method, if there is no file to send, and the name(s)
> of
> the parameter(s) are omitted, then the body is created by concatenating all
> the value(s) of the parameters. ...
>
> For other methods, if the name of the parameter is missing, then the
> parameter is ignored.
>
> So if you have an empty name , the Method cant be GET
>
> regards
> deepak
>
>
>
> On Mon, Jun 14, 2010 at 1:46 PM, Deepak Shetty <sh...@gmail.com> wrote:
>
> > Hi
> > I believe you have to use POST (or PUT) (if you wish to specify empty
> > parameter name in JMeter). If you want to use GET , youll have to
> directly
> > specify this in URL.
> >
> > regards
> > deepak
> >
> >
> > On Mon, Jun 14, 2010 at 1:08 PM, Phan, Van <tp...@ebay.com> wrote:
> >
> >> Hi,
> >> Please help. Thanks in advance.
> >> I want to send a https request w/ json format, and parse json response.
> >> I set up a Thread Group that has HTTP Request Default.
> >> I have HTTP Request which has (json request in parameter value,
> parameter
> >> name is blank,  and HTTP Header
> >> has "Content-Type=application/json", and View result tree listener  to
> get
> >>  response.  I got the request sent out as no Jason attached. Looking at
> >> Exact JSON should be in param.value:
> >>
> >> {"cid":"lsakdjflsa", "pst":"lskajdflsa",
> >>
> "context":{"country":"default","language":"default","view":"default","container":"default"},"gadgets":[{"gid":"1111","moduleId":1}]}
> >>
> >> View Result Tree shows the request has this only ...
> >>
> >> >>>>GET https://localhost:22108/gadgets/metadata
> >>
> >> [no cookies]
> >>
> >> Request Headers:
> >> Connection: keep-alive
> >> Content-Type: application/json
> >> >>>>>>
> >>
> >> Below is sampler, RED is highlight the Jason as Param Value.
> >>
> >>  Sample of HTTPSampler:
> >>
> >>       <HTTPSampler guiclass="HttpTestSampleGui" testclass="HTTPSampler"
> >> testname="/gadgets/metadata" enabled="true">
> >>          <elementProp name="HTTPsampler.Arguments"
> elementType="Arguments"
> >> guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
> >>            <collectionProp name="Arguments.arguments">
> >>              <elementProp name="" elementType="HTTPArgument">
> >>                <boolProp
> name="HTTPArgument.always_encode">true</boolProp>
> >>                <stringProp
> >> name="Argument.value">{&quot;cid&quot;:&quot;lsakdjflsa&quot;,
> >> &quot;pst&quot;:&quot;lskajdflsa&quot;,
> >>
> &quot;context&quot;:{&quot;country&quot;:&quot;default&quot;,&quot;language&quot;:&quot;default&quot;,&quot;view&quot;:&quot;default&quot;,&quot;container&quot;:&quot;default&quot;},&quot;gadgets&quot;:[{&quot;gid&quot;:&quot;1111&quot;,&quot;moduleId&quot;:1}]}</stringProp>
> >>                <stringProp name="Argument.metadata">=</stringProp>
> >>                <boolProp name="HTTPArgument.use_equals">true</boolProp>
> >>              </elementProp>
> >>            </collectionProp>
> >>          </elementProp>
> >>          <stringProp name="HTTPSampler.domain">localhost</stringProp>
> >>          <stringProp name="HTTPSampler.port">22108</stringProp>
> >>          <stringProp name="HTTPSampler.protocol">https</stringProp>
> >>          <stringProp name="HTTPSampler.contentEncoding"></stringProp>
> >>          <stringProp
> >> name="HTTPSampler.path">/gadgets/metadata</stringProp>
> >>          <stringProp name="HTTPSampler.method">GET</stringProp>
> >>          <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
> >>          <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
> >>          <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
> >>          <boolProp name="HTTPSampler.DO_MULTIPART_POST">true</boolProp>
> >>          <stringProp name="HTTPSampler.mimetype"></stringProp>
> >>          <stringProp name="HTTPSampler.FILE_NAME"></stringProp>
> >>          <stringProp name="HTTPSampler.FILE_FIELD"></stringProp>
> >>          <stringProp name="HTTPSampler.monitor">false</stringProp>
> >>          <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
> >>        </HTTPSampler>
> >>        <hashTree/>
> >>
> >> Thanks a lot.
> >> Van
> >>
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

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


Re: Problem w/ json in https request

Posted by Deepak Shetty <sh...@gmail.com>.
Hi
use POST , not PUT.
The response tab is what your application responds with (Im assuming you
have it as Show Text). If it isnt giving you what you expect , then possibly
we are not sending the data to it correctly(assuming the app works
correctly). if you have access to the app logs then this is easy to figure
out , if not then you need to compare with any working request


regards
deepak

On Mon, Jun 14, 2010 at 2:28 PM, Phan, Van <tp...@ebay.com> wrote:

> Thank you Deepak.
> Yes, I have to change it to PUT to get 200 success code back.
> However, the response in View Result Tree, is empty.
> How could I the actual response in RESPONSE tab?
> Thanks a lot for your help.
>
> Van
>
> -----Original Message-----
> From: Deepak Shetty [mailto:shettyd@gmail.com]
> Sent: Monday, June 14, 2010 2:00 PM
> To: JMeter Users List
> Subject: Re: Problem w/ json in https request
>
> Just to confirm
>
> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#HTTP_Request
>
> For the POST and PUT method, if there is no file to send, and the name(s)
> of
> the parameter(s) are omitted, then the body is created by concatenating all
> the value(s) of the parameters. ...
>
> For other methods, if the name of the parameter is missing, then the
> parameter is ignored.
>
> So if you have an empty name , the Method cant be GET
>
> regards
> deepak
>
>
>
> On Mon, Jun 14, 2010 at 1:46 PM, Deepak Shetty <sh...@gmail.com> wrote:
>
> > Hi
> > I believe you have to use POST (or PUT) (if you wish to specify empty
> > parameter name in JMeter). If you want to use GET , youll have to
> directly
> > specify this in URL.
> >
> > regards
> > deepak
> >
> >
> > On Mon, Jun 14, 2010 at 1:08 PM, Phan, Van <tp...@ebay.com> wrote:
> >
> >> Hi,
> >> Please help. Thanks in advance.
> >> I want to send a https request w/ json format, and parse json response.
> >> I set up a Thread Group that has HTTP Request Default.
> >> I have HTTP Request which has (json request in parameter value,
> parameter
> >> name is blank,  and HTTP Header
> >> has "Content-Type=application/json", and View result tree listener  to
> get
> >>  response.  I got the request sent out as no Jason attached. Looking at
> >> Exact JSON should be in param.value:
> >>
> >> {"cid":"lsakdjflsa", "pst":"lskajdflsa",
> >>
> "context":{"country":"default","language":"default","view":"default","container":"default"},"gadgets":[{"gid":"1111","moduleId":1}]}
> >>
> >> View Result Tree shows the request has this only ...
> >>
> >> >>>>GET https://localhost:22108/gadgets/metadata
> >>
> >> [no cookies]
> >>
> >> Request Headers:
> >> Connection: keep-alive
> >> Content-Type: application/json
> >> >>>>>>
> >>
> >> Below is sampler, RED is highlight the Jason as Param Value.
> >>
> >>  Sample of HTTPSampler:
> >>
> >>       <HTTPSampler guiclass="HttpTestSampleGui" testclass="HTTPSampler"
> >> testname="/gadgets/metadata" enabled="true">
> >>          <elementProp name="HTTPsampler.Arguments"
> elementType="Arguments"
> >> guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
> >>            <collectionProp name="Arguments.arguments">
> >>              <elementProp name="" elementType="HTTPArgument">
> >>                <boolProp
> name="HTTPArgument.always_encode">true</boolProp>
> >>                <stringProp
> >> name="Argument.value">{&quot;cid&quot;:&quot;lsakdjflsa&quot;,
> >> &quot;pst&quot;:&quot;lskajdflsa&quot;,
> >>
> &quot;context&quot;:{&quot;country&quot;:&quot;default&quot;,&quot;language&quot;:&quot;default&quot;,&quot;view&quot;:&quot;default&quot;,&quot;container&quot;:&quot;default&quot;},&quot;gadgets&quot;:[{&quot;gid&quot;:&quot;1111&quot;,&quot;moduleId&quot;:1}]}</stringProp>
> >>                <stringProp name="Argument.metadata">=</stringProp>
> >>                <boolProp name="HTTPArgument.use_equals">true</boolProp>
> >>              </elementProp>
> >>            </collectionProp>
> >>          </elementProp>
> >>          <stringProp name="HTTPSampler.domain">localhost</stringProp>
> >>          <stringProp name="HTTPSampler.port">22108</stringProp>
> >>          <stringProp name="HTTPSampler.protocol">https</stringProp>
> >>          <stringProp name="HTTPSampler.contentEncoding"></stringProp>
> >>          <stringProp
> >> name="HTTPSampler.path">/gadgets/metadata</stringProp>
> >>          <stringProp name="HTTPSampler.method">GET</stringProp>
> >>          <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
> >>          <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
> >>          <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
> >>          <boolProp name="HTTPSampler.DO_MULTIPART_POST">true</boolProp>
> >>          <stringProp name="HTTPSampler.mimetype"></stringProp>
> >>          <stringProp name="HTTPSampler.FILE_NAME"></stringProp>
> >>          <stringProp name="HTTPSampler.FILE_FIELD"></stringProp>
> >>          <stringProp name="HTTPSampler.monitor">false</stringProp>
> >>          <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
> >>        </HTTPSampler>
> >>        <hashTree/>
> >>
> >> Thanks a lot.
> >> Van
> >>
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

RE: Problem w/ json in https request

Posted by "Phan, Van" <tp...@ebay.com>.
Thank you Deepak.
Yes, I have to change it to PUT to get 200 success code back. 
However, the response in View Result Tree, is empty.
How could I the actual response in RESPONSE tab?
Thanks a lot for your help.

Van

-----Original Message-----
From: Deepak Shetty [mailto:shettyd@gmail.com] 
Sent: Monday, June 14, 2010 2:00 PM
To: JMeter Users List
Subject: Re: Problem w/ json in https request

Just to confirm
http://jakarta.apache.org/jmeter/usermanual/component_reference.html#HTTP_Request

For the POST and PUT method, if there is no file to send, and the name(s) of
the parameter(s) are omitted, then the body is created by concatenating all
the value(s) of the parameters. ...

For other methods, if the name of the parameter is missing, then the
parameter is ignored.

So if you have an empty name , the Method cant be GET

regards
deepak



On Mon, Jun 14, 2010 at 1:46 PM, Deepak Shetty <sh...@gmail.com> wrote:

> Hi
> I believe you have to use POST (or PUT) (if you wish to specify empty
> parameter name in JMeter). If you want to use GET , youll have to directly
> specify this in URL.
>
> regards
> deepak
>
>
> On Mon, Jun 14, 2010 at 1:08 PM, Phan, Van <tp...@ebay.com> wrote:
>
>> Hi,
>> Please help. Thanks in advance.
>> I want to send a https request w/ json format, and parse json response.
>> I set up a Thread Group that has HTTP Request Default.
>> I have HTTP Request which has (json request in parameter value, parameter
>> name is blank,  and HTTP Header
>> has "Content-Type=application/json", and View result tree listener  to get
>>  response.  I got the request sent out as no Jason attached. Looking at
>> Exact JSON should be in param.value:
>>
>> {"cid":"lsakdjflsa", "pst":"lskajdflsa",
>> "context":{"country":"default","language":"default","view":"default","container":"default"},"gadgets":[{"gid":"1111","moduleId":1}]}
>>
>> View Result Tree shows the request has this only ...
>>
>> >>>>GET https://localhost:22108/gadgets/metadata
>>
>> [no cookies]
>>
>> Request Headers:
>> Connection: keep-alive
>> Content-Type: application/json
>> >>>>>>
>>
>> Below is sampler, RED is highlight the Jason as Param Value.
>>
>>  Sample of HTTPSampler:
>>
>>       <HTTPSampler guiclass="HttpTestSampleGui" testclass="HTTPSampler"
>> testname="/gadgets/metadata" enabled="true">
>>          <elementProp name="HTTPsampler.Arguments" elementType="Arguments"
>> guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
>>            <collectionProp name="Arguments.arguments">
>>              <elementProp name="" elementType="HTTPArgument">
>>                <boolProp name="HTTPArgument.always_encode">true</boolProp>
>>                <stringProp
>> name="Argument.value">{&quot;cid&quot;:&quot;lsakdjflsa&quot;,
>> &quot;pst&quot;:&quot;lskajdflsa&quot;,
>> &quot;context&quot;:{&quot;country&quot;:&quot;default&quot;,&quot;language&quot;:&quot;default&quot;,&quot;view&quot;:&quot;default&quot;,&quot;container&quot;:&quot;default&quot;},&quot;gadgets&quot;:[{&quot;gid&quot;:&quot;1111&quot;,&quot;moduleId&quot;:1}]}</stringProp>
>>                <stringProp name="Argument.metadata">=</stringProp>
>>                <boolProp name="HTTPArgument.use_equals">true</boolProp>
>>              </elementProp>
>>            </collectionProp>
>>          </elementProp>
>>          <stringProp name="HTTPSampler.domain">localhost</stringProp>
>>          <stringProp name="HTTPSampler.port">22108</stringProp>
>>          <stringProp name="HTTPSampler.protocol">https</stringProp>
>>          <stringProp name="HTTPSampler.contentEncoding"></stringProp>
>>          <stringProp
>> name="HTTPSampler.path">/gadgets/metadata</stringProp>
>>          <stringProp name="HTTPSampler.method">GET</stringProp>
>>          <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
>>          <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
>>          <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
>>          <boolProp name="HTTPSampler.DO_MULTIPART_POST">true</boolProp>
>>          <stringProp name="HTTPSampler.mimetype"></stringProp>
>>          <stringProp name="HTTPSampler.FILE_NAME"></stringProp>
>>          <stringProp name="HTTPSampler.FILE_FIELD"></stringProp>
>>          <stringProp name="HTTPSampler.monitor">false</stringProp>
>>          <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
>>        </HTTPSampler>
>>        <hashTree/>
>>
>> Thanks a lot.
>> Van
>>
>
>

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


Re: Problem w/ json in https request

Posted by Deepak Shetty <sh...@gmail.com>.
Just to confirm
http://jakarta.apache.org/jmeter/usermanual/component_reference.html#HTTP_Request

For the POST and PUT method, if there is no file to send, and the name(s) of
the parameter(s) are omitted, then the body is created by concatenating all
the value(s) of the parameters. ...

For other methods, if the name of the parameter is missing, then the
parameter is ignored.

So if you have an empty name , the Method cant be GET

regards
deepak



On Mon, Jun 14, 2010 at 1:46 PM, Deepak Shetty <sh...@gmail.com> wrote:

> Hi
> I believe you have to use POST (or PUT) (if you wish to specify empty
> parameter name in JMeter). If you want to use GET , youll have to directly
> specify this in URL.
>
> regards
> deepak
>
>
> On Mon, Jun 14, 2010 at 1:08 PM, Phan, Van <tp...@ebay.com> wrote:
>
>> Hi,
>> Please help. Thanks in advance.
>> I want to send a https request w/ json format, and parse json response.
>> I set up a Thread Group that has HTTP Request Default.
>> I have HTTP Request which has (json request in parameter value, parameter
>> name is blank,  and HTTP Header
>> has "Content-Type=application/json", and View result tree listener  to get
>>  response.  I got the request sent out as no Jason attached. Looking at
>> Exact JSON should be in param.value:
>>
>> {"cid":"lsakdjflsa", "pst":"lskajdflsa",
>> "context":{"country":"default","language":"default","view":"default","container":"default"},"gadgets":[{"gid":"1111","moduleId":1}]}
>>
>> View Result Tree shows the request has this only ...
>>
>> >>>>GET https://localhost:22108/gadgets/metadata
>>
>> [no cookies]
>>
>> Request Headers:
>> Connection: keep-alive
>> Content-Type: application/json
>> >>>>>>
>>
>> Below is sampler, RED is highlight the Jason as Param Value.
>>
>>  Sample of HTTPSampler:
>>
>>       <HTTPSampler guiclass="HttpTestSampleGui" testclass="HTTPSampler"
>> testname="/gadgets/metadata" enabled="true">
>>          <elementProp name="HTTPsampler.Arguments" elementType="Arguments"
>> guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
>>            <collectionProp name="Arguments.arguments">
>>              <elementProp name="" elementType="HTTPArgument">
>>                <boolProp name="HTTPArgument.always_encode">true</boolProp>
>>                <stringProp
>> name="Argument.value">{&quot;cid&quot;:&quot;lsakdjflsa&quot;,
>> &quot;pst&quot;:&quot;lskajdflsa&quot;,
>> &quot;context&quot;:{&quot;country&quot;:&quot;default&quot;,&quot;language&quot;:&quot;default&quot;,&quot;view&quot;:&quot;default&quot;,&quot;container&quot;:&quot;default&quot;},&quot;gadgets&quot;:[{&quot;gid&quot;:&quot;1111&quot;,&quot;moduleId&quot;:1}]}</stringProp>
>>                <stringProp name="Argument.metadata">=</stringProp>
>>                <boolProp name="HTTPArgument.use_equals">true</boolProp>
>>              </elementProp>
>>            </collectionProp>
>>          </elementProp>
>>          <stringProp name="HTTPSampler.domain">localhost</stringProp>
>>          <stringProp name="HTTPSampler.port">22108</stringProp>
>>          <stringProp name="HTTPSampler.protocol">https</stringProp>
>>          <stringProp name="HTTPSampler.contentEncoding"></stringProp>
>>          <stringProp
>> name="HTTPSampler.path">/gadgets/metadata</stringProp>
>>          <stringProp name="HTTPSampler.method">GET</stringProp>
>>          <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
>>          <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
>>          <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
>>          <boolProp name="HTTPSampler.DO_MULTIPART_POST">true</boolProp>
>>          <stringProp name="HTTPSampler.mimetype"></stringProp>
>>          <stringProp name="HTTPSampler.FILE_NAME"></stringProp>
>>          <stringProp name="HTTPSampler.FILE_FIELD"></stringProp>
>>          <stringProp name="HTTPSampler.monitor">false</stringProp>
>>          <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
>>        </HTTPSampler>
>>        <hashTree/>
>>
>> Thanks a lot.
>> Van
>>
>
>

Re: Problem w/ json in https request

Posted by Deepak Shetty <sh...@gmail.com>.
Hi
I believe you have to use POST (or PUT) (if you wish to specify empty
parameter name in JMeter). If you want to use GET , youll have to directly
specify this in URL.

regards
deepak

On Mon, Jun 14, 2010 at 1:08 PM, Phan, Van <tp...@ebay.com> wrote:

> Hi,
> Please help. Thanks in advance.
> I want to send a https request w/ json format, and parse json response.
> I set up a Thread Group that has HTTP Request Default.
> I have HTTP Request which has (json request in parameter value, parameter
> name is blank,  and HTTP Header
> has "Content-Type=application/json", and View result tree listener  to get
>  response.  I got the request sent out as no Jason attached. Looking at
> Exact JSON should be in param.value:
>
> {"cid":"lsakdjflsa", "pst":"lskajdflsa",
> "context":{"country":"default","language":"default","view":"default","container":"default"},"gadgets":[{"gid":"1111","moduleId":1}]}
>
> View Result Tree shows the request has this only ...
>
> >>>>GET https://localhost:22108/gadgets/metadata
>
> [no cookies]
>
> Request Headers:
> Connection: keep-alive
> Content-Type: application/json
> >>>>>>
>
> Below is sampler, RED is highlight the Jason as Param Value.
>
>  Sample of HTTPSampler:
>
>       <HTTPSampler guiclass="HttpTestSampleGui" testclass="HTTPSampler"
> testname="/gadgets/metadata" enabled="true">
>          <elementProp name="HTTPsampler.Arguments" elementType="Arguments"
> guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
>            <collectionProp name="Arguments.arguments">
>              <elementProp name="" elementType="HTTPArgument">
>                <boolProp name="HTTPArgument.always_encode">true</boolProp>
>                <stringProp
> name="Argument.value">{&quot;cid&quot;:&quot;lsakdjflsa&quot;,
> &quot;pst&quot;:&quot;lskajdflsa&quot;,
> &quot;context&quot;:{&quot;country&quot;:&quot;default&quot;,&quot;language&quot;:&quot;default&quot;,&quot;view&quot;:&quot;default&quot;,&quot;container&quot;:&quot;default&quot;},&quot;gadgets&quot;:[{&quot;gid&quot;:&quot;1111&quot;,&quot;moduleId&quot;:1}]}</stringProp>
>                <stringProp name="Argument.metadata">=</stringProp>
>                <boolProp name="HTTPArgument.use_equals">true</boolProp>
>              </elementProp>
>            </collectionProp>
>          </elementProp>
>          <stringProp name="HTTPSampler.domain">localhost</stringProp>
>          <stringProp name="HTTPSampler.port">22108</stringProp>
>          <stringProp name="HTTPSampler.protocol">https</stringProp>
>          <stringProp name="HTTPSampler.contentEncoding"></stringProp>
>          <stringProp name="HTTPSampler.path">/gadgets/metadata</stringProp>
>          <stringProp name="HTTPSampler.method">GET</stringProp>
>          <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
>          <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
>          <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
>          <boolProp name="HTTPSampler.DO_MULTIPART_POST">true</boolProp>
>          <stringProp name="HTTPSampler.mimetype"></stringProp>
>          <stringProp name="HTTPSampler.FILE_NAME"></stringProp>
>          <stringProp name="HTTPSampler.FILE_FIELD"></stringProp>
>          <stringProp name="HTTPSampler.monitor">false</stringProp>
>          <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
>        </HTTPSampler>
>        <hashTree/>
>
> Thanks a lot.
> Van
>