billputer / go-namecheap

A Go library for using the Namecheap API
MIT License
49 stars 28 forks source link

All endpoints should probably just make POST requests #5

Closed captncraig closed 6 years ago

captncraig commented 7 years ago

After playing with the api in postman for a bit, I have discovered that ALL endpoints work fine if you make an http POST request and provide all data in x-www-form-urlencoded format instead of query parameters.

In all of my testing, all endpoints have worked fine, although query parameters will take priority over post body ones.

This is necessary for things like setHosts, where there can be a ton of data that won't fit reliably in a url string.

I propose making all calls over http post and using http form encoding instead of query strings. Hopefully that will ease some of the odd encoding/escaping behavior we have to work around too, but I wouldn't count on it.

I'm working on a pr to this effect now.

billputer commented 7 years ago

I think that's a great idea. Should be pretty easy to do, although it'll require some work to rewrite the tests where we check for the correct params. Would definitely welcome a PR.

phpfs commented 6 years ago

Any updates on this?

Greetings, phpfs