Google Address Validation API (JSON issue)
Hello,
I am required to pass JSON body as follows:
How would this be done in deluge? I am trying the following and I get an error: Invalid JSON payload received
void addressVal()
{
addr = Map();
addr.put({"address":{"regionCode":"US","locality":"Mountain View","administrativeArea":"CA","postalCode":"94043","addressLines":{"1600 Amphitheatre Pkwy"}},"enableUspsCass":true});
address = "https://addressvalidation.googleapis.com/v1:validateAddress?key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
response = invokeurl
[
url :address
type :POST
parameters:addr
];
info response;
}
Any ideas on how to properly pass JSON with the address?
Thank you!