malformed url exception

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

malformed url exception

Lekshmi Prakash
I have an HTTP request with below url

https://
<servername>/perfmultiple/v1/logs?$filter=${__urlencode({"$and":[{"endTime":{"$gt":"ISODate(2017-02-21T13:53:56.861Z)"}},{"command":"Alibaba"}]})}

I am getting a malformed url exception .

But if I send request with below url it works.There is only one value in
the json array

https://
<servername>/perfmultiple/v1/logs?$filter=${__urlencode({"$and":[{"endTime":{"$gt":"ISODate(2017-02-21T13:53:56.861Z)"}}]})}

How do I handle the scenario when the json array has more than one value?
Reply | Threaded
Open this post in threaded view
|

回复:malformed url exception

Derek Xiao
May be Comma separated, you can try to add an integral quotation marks, and then escape the quotation marks inside




------------------ 原始邮件 ------------------
发件人: "Lekshmi Prakash"<[hidden email]>;
发送时间: 2017年8月27日(星期天) 上午9:29
收件人: "user"<[hidden email]>;
主题: malformed url exception



I have an HTTP request with below url

https://
<servername>/perfmultiple/v1/logs?$filter=${__urlencode({"$and":[{"endTime":{"$gt":"ISODate(2017-02-21T13:53:56.861Z)"}},{"command":"Alibaba"}]})}

I am getting a malformed url exception .

But if I send request with below url it works.There is only one value in
the json array

https://
<servername>/perfmultiple/v1/logs?$filter=${__urlencode({"$and":[{"endTime":{"$gt":"ISODate(2017-02-21T13:53:56.861Z)"}}]})}

How do I handle the scenario when the json array has more than one value?
Reply | Threaded
Open this post in threaded view
|

Re: malformed url exception

Felix Schumacher
In reply to this post by Lekshmi Prakash


Am 27. August 2017 03:29:08 MESZ schrieb Lekshmi Prakash <[hidden email]>:
>I have an HTTP request with below url
>
>https://
><servername>/perfmultiple/v1/logs?$filter=${__urlencode({"$and":[{"endTime":{"$gt":"ISODate(2017-02-21T13:53:56.861Z)"}},{"command":"Alibaba"}]})}

Try to escape the comma with a backslash: \,

Felix

>
>I am getting a malformed url exception .
>
>But if I send request with below url it works.There is only one value
>in
>the json array
>
>https://
><servername>/perfmultiple/v1/logs?$filter=${__urlencode({"$and":[{"endTime":{"$gt":"ISODate(2017-02-21T13:53:56.861Z)"}}]})}
>
>How do I handle the scenario when the json array has more than one
>value?

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: malformed url exception

Lekshmi Prakash
Thanks Felix.
Escaping coma with backslash helped.
Now its working.
Lekshmi

On Sun, Aug 27, 2017 at 1:56 AM, Felix Schumacher <
[hidden email]> wrote:

>
>
> Am 27. August 2017 03:29:08 MESZ schrieb Lekshmi Prakash <
> [hidden email]>:
> >I have an HTTP request with below url
> >
> >https://
> ><servername>/perfmultiple/v1/logs?$filter=${__urlencode({"$
> and":[{"endTime":{"$gt":"ISODate(2017-02-21T13:53:56.
> 861Z)"}},{"command":"Alibaba"}]})}
>
> Try to escape the comma with a backslash: \,
>
> Felix
>
> >
> >I am getting a malformed url exception .
> >
> >But if I send request with below url it works.There is only one value
> >in
> >the json array
> >
> >https://
> ><servername>/perfmultiple/v1/logs?$filter=${__urlencode({"$
> and":[{"endTime":{"$gt":"ISODate(2017-02-21T13:53:56.861Z)"}}]})}
> >
> >How do I handle the scenario when the json array has more than one
> >value?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: malformed url exception

glinius@live.com
This post has NOT been accepted by the mailing list yet.
This post was updated on .
In reply to this post by Lekshmi Prakash
As per JMeter Functions documentation:

If a function parameter contains a comma, then be sure to escape this with "\", otherwise JMeter will treat it as a parameter delimiter
Therefore you need to add a backslash before any comma in your function call and your request should start working as expected. For more information on JMeter Functions check out Apache JMeter Functions - An Introduction guide.

Another approach is ticking "Encode" box for the relevant parameter in the HTTP Request sampler