atog/toggl — pull request #4 by ondrejbartas (2012-04-04 20:52:43+00:00)
Title: Problem with initialization and AUTH

Hello I got problem:

<- "GET /api/v6/sessions.json?output=json HTTP/1.1\r\nContent-Type: application/json\r\nAuthorization: Basic XXXXXXXXXXXXXXXu\r\nConnection: close\r\nHost: www.toggl.com\r\n\r\n"
-> "HTTP/1.1 404 Not Found\r\n"
-> "Date: Wed, 04 Apr 2012 20:19:42 GMT\r\n"
-> "Server: Apache/2.2.14 (Ubuntu)\r\n"
-> "X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 3.0.8\r\n"
-> "X-Rack-Cache: miss\r\n"
-> "X-Runtime: 0.022720\r\n"
-> "Cache-Control: private\r\n"
-> "Content-Length: 1163\r\n"
-> "Status: 404\r\n"
-> "Cache-Control: max-age=0, public\r\n"
-> "Expires: Wed, 04 Apr 2012 20:19:42 GMT\r\n"
-> "Vary: Accept-Encoding\r\n"
-> "Connection: close\r\n"
-> "Content-Type: text/html; charset=utf-8\r\n"
-> "\r\n"
reading 1163 bytes...
-> ""
-> "\r\n\r\n

\r\n \r\n

Page Not Found :(

\r\n \r\n

\r\n

\r\n

\r\n\t

Not found :(

\r\n\t

\r\n\t

Sorry, but the page you were trying to view does not exist.

\r\n\t

It looks like this was the result of either:

\r\n\t

\r\n\t\t
a mistyped address
\r\n\t\t
an out-of-date link
\r\n\t

\r\n\t

\r\n

\r\n

\r\n\r\n"
read 1163 bytes

And I always get this error.

I think problem is that toggle doesn't know sessions.json for GET request.

But if it is not needed you can skip auth method in initialization and do basic auth for all resquest.

Conflicts:

lib/toggl.rb