jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phan, Van" <tp...@ebay.com>
Subject RE: Problem w/ json in https request
Date Mon, 14 Jun 2010 21:59:23 GMT
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 <tphan@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 <shettyd@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 <tphan@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


Mime
View raw message