Google url Shortning API call with Deluge

Google url Shortning API call with Deluge

I am attempting to shorten an url using the Google url Shortning API. However the scripting is returning an error

Below is how I have scripted the API call in deluge:

headerMap = {"Content-type" : "application/json"};
requestBody = {"longUrl":"http://www.google.com"};

Here is the error return in the response:

{"responseCode":"400","responseText":"The request had bad syntax or was inherently impossible to be satisfied."}


Any help in resolving this issue would be greatly appreciated.