You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Toni Menendez Lopez <to...@gmail.com> on 2011/04/11 16:45:14 UTC

Executing request with JSON

Hello everybody,

As anyone of you created any scenarios with JSON in the requests ? I need to
create one, and no idea how to do it !

Toni.

Re: Executing request with JSON

Posted by apc <ap...@apc.kg>.
Use TCP Request or Raw Request, it will work for you, but only without
keep-alive

--
View this message in context: http://jmeter.512774.n5.nabble.com/Executing-request-with-JSON-tp4296082p4300225.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Re: Executing request with JSON

Posted by Adrian Speteanu <as...@gmail.com>.
My bad, it does work.

On Thu, Apr 14, 2011 at 6:35 PM, sebb <se...@gmail.com> wrote:

> On 14 April 2011 14:59, Adrian Speteanu <as...@gmail.com> wrote:
> > Hello sebb,
> >
> > Will adjusting the headers work for this request by using the Header
> > Manager? Last time I tried, the headers weren't sent (I assumed the
> header
> > manager only works for Http Samplers).
>
> Try it and see - it's trivial to test using the mirror server.
>
> > Regards,
> > Adrian
> >
> > On Wed, Apr 13, 2011 at 2:41 PM, sebb <se...@gmail.com> wrote:
> >
> >> On 13 April 2011 10:04, Toni Menendez Lopez <to...@gmail.com>
> wrote:
> >> > Deepack,
> >> >
> >> > My json rquest is so easy, I have to send this reques for example,
> >> >
> >> > POST /Mytest/beta?
> >> >
> >> > Accept: application/json
> >> > user-agent: automationDM
> >> > x-odp-version: 1.0
> >> > x-locale: en
> >> > Content-Length: 322
> >> > Content-Type: application/json;charset=utf-8
> >> > Content-Encoding: gzip
> >> > Host: 1.1.1.1
> >> > Connection: Keep-Alive
> >> > Expect: 100-Continue
> >> > Accept-Encoding: gzip
> >> >
> >> > {
> >> >   "id": 1,
> >> >   "jsonrpc": "2.0",
> >> >   "method": "startSession",
> >> >   "params": {
> >> >      "deviceId": {
> >> >         "iccid": "12345678",
> >> >         "value": "12332111"
> >> >      },
> >> >      "hash": "JtcJvlRe13rNSAfzTynp9Ibve3Q=",
> >> >      "subscriberId": {
> >> >         "type": "mobile",
> >> >         "value": "666777888"
> >> >      }
> >> >   }
> >> > }
> >> >
> >> > And of course values inside the json, can be variables ?
> >> >
> >> > Waht do you think is the best solution ?
> >>
> >> You might find that
> >>
> >>
> >>
> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#SOAP/XML-RPC_Request
> >>
> >> will work for you (obviously don't select "Send Soap Action")
> >>
> >> Adjust headers using a child header manager.
> >>
> >> > Toni.
> >> >
> >> > 2011/4/11 Deepak Shetty <sh...@gmail.com>
> >> >
> >> >> Depends on how it is being passed - If you passing it as the value of
> a
> >> >> parameter , then its just a string , no different from anything else.
> >> >>
> >> >>  if you are just posting the value , then you have to ensure that in
> >> JMeter
> >> >> you dont give a name (in send parameters with request), just the
> value
> >> (its
> >> >> still a string , no different from any other).
> >> >> JSON as response is also a string , no different from any other
> >> response.
> >> >> perhaps if you tell us what problem you are facing , it might help.
> >> >>
> >> >> regards
> >> >> deepak
> >> >>
> >> >>
> >> >> On Mon, Apr 11, 2011 at 7:45 AM, Toni Menendez Lopez <
> >> tonimenen@gmail.com>wrote:
> >> >>
> >> >>> Hello everybody,
> >> >>>
> >> >>> As anyone of you created any scenarios with JSON in the requests ? I
> >> need
> >> >>> to
> >> >>> create one, and no idea how to do it !
> >> >>>
> >> >>> Toni.
> >> >>>
> >> >>
> >> >>
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> 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: Executing request with JSON

Posted by sebb <se...@gmail.com>.
On 14 April 2011 14:59, Adrian Speteanu <as...@gmail.com> wrote:
> Hello sebb,
>
> Will adjusting the headers work for this request by using the Header
> Manager? Last time I tried, the headers weren't sent (I assumed the header
> manager only works for Http Samplers).

Try it and see - it's trivial to test using the mirror server.

> Regards,
> Adrian
>
> On Wed, Apr 13, 2011 at 2:41 PM, sebb <se...@gmail.com> wrote:
>
>> On 13 April 2011 10:04, Toni Menendez Lopez <to...@gmail.com> wrote:
>> > Deepack,
>> >
>> > My json rquest is so easy, I have to send this reques for example,
>> >
>> > POST /Mytest/beta?
>> >
>> > Accept: application/json
>> > user-agent: automationDM
>> > x-odp-version: 1.0
>> > x-locale: en
>> > Content-Length: 322
>> > Content-Type: application/json;charset=utf-8
>> > Content-Encoding: gzip
>> > Host: 1.1.1.1
>> > Connection: Keep-Alive
>> > Expect: 100-Continue
>> > Accept-Encoding: gzip
>> >
>> > {
>> >   "id": 1,
>> >   "jsonrpc": "2.0",
>> >   "method": "startSession",
>> >   "params": {
>> >      "deviceId": {
>> >         "iccid": "12345678",
>> >         "value": "12332111"
>> >      },
>> >      "hash": "JtcJvlRe13rNSAfzTynp9Ibve3Q=",
>> >      "subscriberId": {
>> >         "type": "mobile",
>> >         "value": "666777888"
>> >      }
>> >   }
>> > }
>> >
>> > And of course values inside the json, can be variables ?
>> >
>> > Waht do you think is the best solution ?
>>
>> You might find that
>>
>>
>> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#SOAP/XML-RPC_Request
>>
>> will work for you (obviously don't select "Send Soap Action")
>>
>> Adjust headers using a child header manager.
>>
>> > Toni.
>> >
>> > 2011/4/11 Deepak Shetty <sh...@gmail.com>
>> >
>> >> Depends on how it is being passed - If you passing it as the value of a
>> >> parameter , then its just a string , no different from anything else.
>> >>
>> >>  if you are just posting the value , then you have to ensure that in
>> JMeter
>> >> you dont give a name (in send parameters with request), just the value
>> (its
>> >> still a string , no different from any other).
>> >> JSON as response is also a string , no different from any other
>> response.
>> >> perhaps if you tell us what problem you are facing , it might help.
>> >>
>> >> regards
>> >> deepak
>> >>
>> >>
>> >> On Mon, Apr 11, 2011 at 7:45 AM, Toni Menendez Lopez <
>> tonimenen@gmail.com>wrote:
>> >>
>> >>> Hello everybody,
>> >>>
>> >>> As anyone of you created any scenarios with JSON in the requests ? I
>> need
>> >>> to
>> >>> create one, and no idea how to do it !
>> >>>
>> >>> Toni.
>> >>>
>> >>
>> >>
>> >
>>
>> ---------------------------------------------------------------------
>> 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: Executing request with JSON

Posted by Adrian Speteanu <as...@gmail.com>.
Hello sebb,

Will adjusting the headers work for this request by using the Header
Manager? Last time I tried, the headers weren't sent (I assumed the header
manager only works for Http Samplers).

Regards,
Adrian

On Wed, Apr 13, 2011 at 2:41 PM, sebb <se...@gmail.com> wrote:

> On 13 April 2011 10:04, Toni Menendez Lopez <to...@gmail.com> wrote:
> > Deepack,
> >
> > My json rquest is so easy, I have to send this reques for example,
> >
> > POST /Mytest/beta?
> >
> > Accept: application/json
> > user-agent: automationDM
> > x-odp-version: 1.0
> > x-locale: en
> > Content-Length: 322
> > Content-Type: application/json;charset=utf-8
> > Content-Encoding: gzip
> > Host: 1.1.1.1
> > Connection: Keep-Alive
> > Expect: 100-Continue
> > Accept-Encoding: gzip
> >
> > {
> >   "id": 1,
> >   "jsonrpc": "2.0",
> >   "method": "startSession",
> >   "params": {
> >      "deviceId": {
> >         "iccid": "12345678",
> >         "value": "12332111"
> >      },
> >      "hash": "JtcJvlRe13rNSAfzTynp9Ibve3Q=",
> >      "subscriberId": {
> >         "type": "mobile",
> >         "value": "666777888"
> >      }
> >   }
> > }
> >
> > And of course values inside the json, can be variables ?
> >
> > Waht do you think is the best solution ?
>
> You might find that
>
>
> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#SOAP/XML-RPC_Request
>
> will work for you (obviously don't select "Send Soap Action")
>
> Adjust headers using a child header manager.
>
> > Toni.
> >
> > 2011/4/11 Deepak Shetty <sh...@gmail.com>
> >
> >> Depends on how it is being passed - If you passing it as the value of a
> >> parameter , then its just a string , no different from anything else.
> >>
> >>  if you are just posting the value , then you have to ensure that in
> JMeter
> >> you dont give a name (in send parameters with request), just the value
> (its
> >> still a string , no different from any other).
> >> JSON as response is also a string , no different from any other
> response.
> >> perhaps if you tell us what problem you are facing , it might help.
> >>
> >> regards
> >> deepak
> >>
> >>
> >> On Mon, Apr 11, 2011 at 7:45 AM, Toni Menendez Lopez <
> tonimenen@gmail.com>wrote:
> >>
> >>> Hello everybody,
> >>>
> >>> As anyone of you created any scenarios with JSON in the requests ? I
> need
> >>> to
> >>> create one, and no idea how to do it !
> >>>
> >>> Toni.
> >>>
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

Re: Executing request with JSON

Posted by Toni Menendez Lopez <to...@gmail.com>.
Great man,

I´ve been working on it last days and it work perfectly.

Thanks one more time !

2011/4/13 sebb <se...@gmail.com>

> On 13 April 2011 10:04, Toni Menendez Lopez <to...@gmail.com> wrote:
> > Deepack,
> >
> > My json rquest is so easy, I have to send this reques for example,
> >
> > POST /Mytest/beta?
> >
> > Accept: application/json
> > user-agent: automationDM
> > x-odp-version: 1.0
> > x-locale: en
> > Content-Length: 322
> > Content-Type: application/json;charset=utf-8
> > Content-Encoding: gzip
> > Host: 1.1.1.1
> > Connection: Keep-Alive
> > Expect: 100-Continue
> > Accept-Encoding: gzip
> >
> > {
> >   "id": 1,
> >   "jsonrpc": "2.0",
> >   "method": "startSession",
> >   "params": {
> >      "deviceId": {
> >         "iccid": "12345678",
> >         "value": "12332111"
> >      },
> >      "hash": "JtcJvlRe13rNSAfzTynp9Ibve3Q=",
> >      "subscriberId": {
> >         "type": "mobile",
> >         "value": "666777888"
> >      }
> >   }
> > }
> >
> > And of course values inside the json, can be variables ?
> >
> > Waht do you think is the best solution ?
>
> You might find that
>
>
> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#SOAP/XML-RPC_Request
>
> will work for you (obviously don't select "Send Soap Action")
>
> Adjust headers using a child header manager.
>
> > Toni.
> >
> > 2011/4/11 Deepak Shetty <sh...@gmail.com>
> >
> >> Depends on how it is being passed - If you passing it as the value of a
> >> parameter , then its just a string , no different from anything else.
> >>
> >>  if you are just posting the value , then you have to ensure that in
> JMeter
> >> you dont give a name (in send parameters with request), just the value
> (its
> >> still a string , no different from any other).
> >> JSON as response is also a string , no different from any other
> response.
> >> perhaps if you tell us what problem you are facing , it might help.
> >>
> >> regards
> >> deepak
> >>
> >>
> >> On Mon, Apr 11, 2011 at 7:45 AM, Toni Menendez Lopez <
> tonimenen@gmail.com>wrote:
> >>
> >>> Hello everybody,
> >>>
> >>> As anyone of you created any scenarios with JSON in the requests ? I
> need
> >>> to
> >>> create one, and no idea how to do it !
> >>>
> >>> Toni.
> >>>
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

Re: Executing request with JSON

Posted by sebb <se...@gmail.com>.
On 13 April 2011 10:04, Toni Menendez Lopez <to...@gmail.com> wrote:
> Deepack,
>
> My json rquest is so easy, I have to send this reques for example,
>
> POST /Mytest/beta?
>
> Accept: application/json
> user-agent: automationDM
> x-odp-version: 1.0
> x-locale: en
> Content-Length: 322
> Content-Type: application/json;charset=utf-8
> Content-Encoding: gzip
> Host: 1.1.1.1
> Connection: Keep-Alive
> Expect: 100-Continue
> Accept-Encoding: gzip
>
> {
>   "id": 1,
>   "jsonrpc": "2.0",
>   "method": "startSession",
>   "params": {
>      "deviceId": {
>         "iccid": "12345678",
>         "value": "12332111"
>      },
>      "hash": "JtcJvlRe13rNSAfzTynp9Ibve3Q=",
>      "subscriberId": {
>         "type": "mobile",
>         "value": "666777888"
>      }
>   }
> }
>
> And of course values inside the json, can be variables ?
>
> Waht do you think is the best solution ?

You might find that

http://jakarta.apache.org/jmeter/usermanual/component_reference.html#SOAP/XML-RPC_Request

will work for you (obviously don't select "Send Soap Action")

Adjust headers using a child header manager.

> Toni.
>
> 2011/4/11 Deepak Shetty <sh...@gmail.com>
>
>> Depends on how it is being passed - If you passing it as the value of a
>> parameter , then its just a string , no different from anything else.
>>
>>  if you are just posting the value , then you have to ensure that in JMeter
>> you dont give a name (in send parameters with request), just the value (its
>> still a string , no different from any other).
>> JSON as response is also a string , no different from any other response.
>> perhaps if you tell us what problem you are facing , it might help.
>>
>> regards
>> deepak
>>
>>
>> On Mon, Apr 11, 2011 at 7:45 AM, Toni Menendez Lopez <to...@gmail.com>wrote:
>>
>>> Hello everybody,
>>>
>>> As anyone of you created any scenarios with JSON in the requests ? I need
>>> to
>>> create one, and no idea how to do it !
>>>
>>> Toni.
>>>
>>
>>
>

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


Re: Executing request with JSON

Posted by Toni Menendez Lopez <to...@gmail.com>.
Deepack,

My json rquest is so easy, I have to send this reques for example,

POST /Mytest/beta?

Accept: application/json
user-agent: automationDM
x-odp-version: 1.0
x-locale: en
Content-Length: 322
Content-Type: application/json;charset=utf-8
Content-Encoding: gzip
Host: 1.1.1.1
Connection: Keep-Alive
Expect: 100-Continue
Accept-Encoding: gzip

{
   "id": 1,
   "jsonrpc": "2.0",
   "method": "startSession",
   "params": {
      "deviceId": {
         "iccid": "12345678",
         "value": "12332111"
      },
      "hash": "JtcJvlRe13rNSAfzTynp9Ibve3Q=",
      "subscriberId": {
         "type": "mobile",
         "value": "666777888"
      }
   }
}

And of course values inside the json, can be variables ?

Waht do you think is the best solution ?

Toni.

2011/4/11 Deepak Shetty <sh...@gmail.com>

> Depends on how it is being passed - If you passing it as the value of a
> parameter , then its just a string , no different from anything else.
>
>  if you are just posting the value , then you have to ensure that in JMeter
> you dont give a name (in send parameters with request), just the value (its
> still a string , no different from any other).
> JSON as response is also a string , no different from any other response.
> perhaps if you tell us what problem you are facing , it might help.
>
> regards
> deepak
>
>
> On Mon, Apr 11, 2011 at 7:45 AM, Toni Menendez Lopez <to...@gmail.com>wrote:
>
>> Hello everybody,
>>
>> As anyone of you created any scenarios with JSON in the requests ? I need
>> to
>> create one, and no idea how to do it !
>>
>> Toni.
>>
>
>

Re: Executing request with JSON

Posted by Deepak Shetty <sh...@gmail.com>.
Depends on how it is being passed - If you passing it as the value of a
parameter , then its just a string , no different from anything else.

 if you are just posting the value , then you have to ensure that in JMeter
you dont give a name (in send parameters with request), just the value (its
still a string , no different from any other).
JSON as response is also a string , no different from any other response.
perhaps if you tell us what problem you are facing , it might help.

regards
deepak

On Mon, Apr 11, 2011 at 7:45 AM, Toni Menendez Lopez <to...@gmail.com>wrote:

> Hello everybody,
>
> As anyone of you created any scenarios with JSON in the requests ? I need
> to
> create one, and no idea how to do it !
>
> Toni.
>