3

On postman, I want to hit a GET API, where I want to pass a param channelCategory : News|Movies, which is an array of strings. To separate those strings we are using pipe |. After hitting the API I am getting an empty response. So what I can do to get the response?

This API works perfectly in SOAPUI tool.

I tried using the below combinations but was not successful. News"|"Movies News%7CMovies

Please note : And I can't use comma instead of pipe.

AlpacaFur
  • 194
  • 2
  • 12
Kunal Kaushal
  • 57
  • 1
  • 6

1 Answers1

2

Here is some more information that may be useful around this subject:

You may use operators in request expression, depending on if you want to combine different values for a single argument or combine different arguments. In my case, I use variables for filtering an argument named 'tags' in my collection to do a 'OR' for a same argument :

(|(tags=CONFIGURATION)(tags=EXPLOITATION))

which translates as

(%7C(tags%3DCONFIGURATION)(tags%3DEXPLOITATION))

In fact, I realize that your initial translation with %7C was correct, but you probably misused it (%3D corresponds to '=')

The other combination I suggested you is more related to a list of arguments that are to be excluded from the response and It seems to have the same usage (except that there is no argument mentioned, which is not a problem in my case, and yours). My requests looks like this:

GET http:// .... /?filter={{filter}}&exclude={{exclude}}&expand={{expand}}

with

filter=(|(tags=CONFIGURATION)(tags=EXPLOITATION))
exclude=[{"key":"exclude","value":"href,metadata,name,arguments"}]
expand=id

and is translated, in cURL, like this:

'http: ....  ?filter=(%7C(tags%3DCONFIGURATION)(tags%3DEXPLOITATION))&exclude=href%2Cmetadata%2Cname%2Carguments&expand=id'  ....

to do a 'OR' you could probably try (|(channelCategory=News)(channelCategory=Movies)) with success though the other form (as a list) seem to fulfill your needs.

A.Joly
  • 2,317
  • 2
  • 20
  • 25