Thursday, 15 March 2012

c - Parsing POST request if value contains '&' character -



c - Parsing POST request if value contains '&' character -

how can 'key=value' pairs get/post request when value contains '&', reserved separator? mean if request variables 'key1=val&ue1' , 'key2=valu&e2'.

the value not allowed contain & symbol. may contain logical & & must %-encoded (%26).

so split string @ each &, , split key , value in each segment @ first =, before %-decoding. (i've seen error of %-decoding whole string prior splitting pieces. doesn't work, , question demonstrates why not.)

c cgi query-string

No comments:

Post a Comment