ninenines / cowlib

Support library for manipulating Web protocols.
ISC License
279 stars 173 forks source link

cow_qs:qs can not have integer value? #50

Closed dcy closed 7 years ago

dcy commented 7 years ago

Hi! cow_qs:qs([{<<"digit">>, 1}]). will throw error:

** exception error: no function clause matching cow_qs:urlencode(1,<<"&digit=">>) (/home/dcy/hisir/epush/_build/default/lib/cowlib/src/cow_qs.erl, line 429)
     in function  cow_qs:qs/2 (/home/dcy/hisir/epush/_build/default/lib/cowlib/src/cow_qs.erl, line 183

Can't it have integer value?

essen commented 7 years ago

No.

dcy commented 7 years ago

Thanks

essen commented 7 years ago

For the reason: this function is the equivalent of the parsing function and echoes the same properties (query strings are key/value strings). A higher level function could take care of integers and others like you need.