2

I'm trying to figure out how to write a google places POST request using HTTParty. I was able to do a GET request but can't figure out how to work around the fact that Google Places has a nested parameter to post into. Here is the json syntax from the api documentation. Can someone help me translate this into the syntax that can work with HTTParty.post

POST https://maps.googleapis.com/maps/api/place/add/json?sensor=true_or_false&key=api_key HTTP/1.1
Host: maps.googleapis.com

{
  "location": {
    "lat": -33.8669710,
    "lng": 151.1958750
  },
  "accuracy": 50,
  "name": "Google Shoes!",
  "types": ["shoe_store"],
  "language": "en-AU"
}
Ray A.
  • 161
  • 1
  • 1
  • 9

1 Answers1

0

The httparty gem includes an example that posts nested JSON to a server.

Brett Bender
  • 19,388
  • 2
  • 38
  • 46
  • Thanks. However now I'm getting a content-length required error. any ideas on how to workaround that? – Ray A. Sep 22 '11 at 14:45