Open GoogleCodeExporter opened 9 years ago
Oupsss
Inside generate_request(), you should ignore req.url(uri.to_s), it's me trying
to understand what was going on :)
The line that calls Faraday and then unescape() is
req.url(Addressable::URI.parse(uri).normalize.to_s)
Original comment by tkrotoff
on 30 Aug 2012 at 10:46
I don't think it is a bug. + sign should probably not be inside an url.
The solution here is not to pass the local time (+02:00) but the UTC time
instead:
result = @client.execute(
api_method: @calendar.events.list,
parameters: {
calendarId: calendar_id,
timeMin: time_min.utc.iso8601,
timeMax: time_max.utc.iso8601
})
timeMin and timeMax are now:
"2012-07-28T22:00:00Z"
so no more + sign.
Original comment by tkrotoff
on 31 Aug 2012 at 12:32
I'm in complete agreement that avoiding the '+' character is a best practice.
However, I still consider this a bug. Unfortunately, it's not one that's likely
to be fixed soon. Way too many dependencies involved in this issue. That said,
Faraday may end up exposing a mechanism by which handling parameters could be
delegated to something else.
https://github.com/technoweenie/faraday/issues/182
Original comment by bobaman@google.com
on 31 Aug 2012 at 9:03
I'm having a similar issue, but haven't been able to resolve it by using
.utc.iso6801.
I'm calling:
@result = client.execute({
api_method: service.freebusy.query,
parameters: {
timeMin: Time.now.utc.iso8601,
timeMax: 3.days.from_now.utc.iso8601,
items: [{id: "#{@calendar.calendar_id}"}]
},
headers: {'Content-Type' => 'application/json'}
})
I'm getting back a 400, "Missing timeMin parameter" error. Am I missing
something else with how I need to submit these params?
Original comment by forr...@skedipity.com
on 12 Dec 2012 at 4:20
Finally got this working and the fix was non-intuitive for me:
@result = client.execute({
api_method: service.freebusy.query,
body: JSON.dump({
timeMin: Time.now.utc.iso8601,
timeMax: 3.days.from_now.utc.iso8601,
items: [{id: "#{@calendar.calendar_id}"}]
},
headers: {'Content-Type' => 'application/json'}
})
Basically, when timeMin was sent in the parameters field, it wasn't interpreted
correctly, but when sent in the body, it was.
Original comment by forr...@skedipity.com
on 12 Dec 2012 at 4:48
See https://github.com/google/google-api-ruby-client/issues/38 for further
updates.
Original comment by sba...@google.com
on 8 Apr 2013 at 8:48
Original issue reported on code.google.com by
tkrotoff
on 30 Aug 2012 at 7:36