Merge pull request #4 from mhmaguire/master

fixed json encoding, added content-type header to curl request
made request types const
if the request method is a PUT or POST, set the json content type header and json encode the payload else build an http query
made request types const
if the request method is a PUT or POST, set the json content type header and json encode the payload else build an http query