简体   繁体   中英

What if query string itself contains comma when using comma-separated query string API?

I'm designing an API, but here is a problem:

?merchantCategoryName=[Adult,Fantasy,Mac]
&mappedCategoryID=[701,80,22]
&merchantID=36330&outputType=xml

This is ideal situation, but what if merchantCategoryName contains a comma like this: ( Ad,ult is a merchantCategoryName )

?merchantCategoryName=[Ad,ult,Fantasy,Mac]
&mappedCategoryID=[701,80,22]
&merchantID=36330&outputType=xml

Then will be disorder, if I use base64 it seems not work, if I use htmlentities it seems , 's entity is , . so how can I solve this?

You can use this format:

?merchantCategoryName[]=Adult&
merchantCategoryName[]=Fantasy&
merchantCategoryName[]=Mac&
merchantID=36330&
outputType=xml

See this question for details

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM