arduino-libraries / ArduinoHttpClient

Arduino HTTP Client library
282 stars 170 forks source link

Add URL Encoder class #61

Closed sandeepmistry closed 5 years ago

sandeepmistry commented 5 years ago

As discussed with @tigoe, is this what you had in mind or do you prefer a C style API without the class? (Something like urlencode(input))

tigoe commented 5 years ago

Good question, I can see the sense of a class, in fact I could even see how it might belong in Stream, because other libs might need it too. So I guess a class might make sense as it'd be easier to port it?

sandeepmistry commented 5 years ago

Yes, let's go with class, right now it's the same syntax as Java: https://docs.oracle.com/javase/7/docs/api/java/net/URLEncoder.html

String URLEncoder.encode(String s)

@cmaglie had one suggestion to make the functions static, which I will push soon.

tigoe commented 5 years ago

Good idea, @cmaglie, I agree.