I'm trying to post a JSON request to Google Places using httparty.
However when I post I receive a content-length required error. I
can't seem to find out how to work around this. Can someone please
look at my code below and let me know how to resolve thsi issue.
Thanks.
lib/Partay.rb
require 'rubygems'
require 'httparty'
class Partay
include HTTParty
base_uri '
https://maps.googleapis.com'
end
#add to google API
options = {
:location => {
:lat => '33.71064',
:lng => '-84.479605'
}
}
{
:accuracy => '50',
:name=>"Rays NewshoeTree",
:types=> "shoe_store",
:language=> "en-AU"
}
-----------------------------------------------------
locations_controller.rb
class LocationsController
def index
require 'Partay
@reference = Partay.post('/maps/api/place/add/json?
sensor=false&key=AIzaSyA1mwwvv3NAL_N7gNRf_0uqK2pfiXEqkZc1',
{ :location => {:lat => '33.71064',:lng => '-84.479605'}} )
...
end
My Question is... Where do I put the content-length headers, or should
I be doing something differently, so that it is not needed.
Thanks.