Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Commas in the parasoft API URL

rituparna
rituparna Posts: 1

Hi There

My question is- Does comma is accepted in the API URL in Parasoft 9.10 ?
Postman works for certain URL when passed with comma but when the same URL passed in Parasoft , it returns Bad request

When I am passing this
orderBy=companyCd,asc&orderBy=fundCd,desc&page=1&pageSize=10

I see in the Transport the request changes to -
orderBy=companyCd%2Casc&orderBy=fundCd%2Cdesc&page=1&pageSize=10

And returns 400- Bad request error.
Please advise why Parasoft is adding this extra %2C inplace of comma(,)

thanks in advance

Comments

  • benken_parasoft
    benken_parasoft Posts: 1,228 ✭✭✭
    edited July 2018

    This is a current limitation in the REST Client. You could work around this by using some other tool. You could consider calling "curl" from an External tool, for example.

    Now, for the explanation:
    The URI specification defines certain characters as being reserved since they are used as delimiters. Whenever such characters need to be used for the value of something, like a path segment or query param, they need to be percent-encoded so as not to be treated as a delimiter. Some of these reserved characters are sub delimiters which include ampersand ('&') and equals sign ('=') which are used to delimit query parameters. However, the URI spec also defines certain characters as being sub delimiters, such as comma (','). In one sense, query parameters may seem two dimensional, each having a name and a value using '&' and '=' as delimiters. However, there can actually be a third dimension, where an additional sub delimiter is used to break up the value, such as comma (',').

    As you observed, it looks like the REST Client doesn't recognize certain types of sub delimiters include comma. This limitation is also expressed in the Query parameters tab, where we express the parameters in two dimensions only, where we assume each parameter is a single value and not a list or table of nested values.