marcelcaraciolo
unread,Apr 11, 2011, 10:28:39 AM4/11/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Apontador API
Pessoal,
Estou tentando me autenticar no Apontador Places com a aplicação que
cadastrei junto ao Apontador API.
Ao usar a lib em python que vocês desenvolveram , seguindo o exemplo
mobile.py presente obtenho a seguinte resposta do servidor:
<html><head><title>Apache Tomcat/6.0.18 - Error report</
title><style><!--H1 {font-family:Tahoma,Arial,sans-
serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-
family:Tahoma,Arial,sans-serif;color:white;background-
color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-
serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-
family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B
{font-family:Tahoma,Arial,sans-serif;color:white;background-
color:#525D76;} P {font-family:Tahoma,Arial,sans-
serif;background:white;color:black;font-size:12px;}A {color : black;}
A.name {color : black;}HR {color : #525D76;}--></style> </
head><body><h1>HTTP Status 401 - </h1><HR size="1"
noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b>
<u></u></p><p><b>description</b> <u>This request requires HTTP
authentication ().</u></p><HR size="1" noshade="noshade"><h3>Apache
Tomcat/6.0.18</h3></body></html>
Traceback (most recent call last):
File "mobile.py", line 54, in <module>
raise Exception("Invalid response %s." % resp['status'])
Exception: Invalid response 401.
Pelo que percebi o erro 401; This request requires HTTP authentication
()
A falha seria nesta parte:
consumer = oauth.OAuthConsumer(consumer_key, consumer_secret)
signature_method = oauth.OAuthSignatureMethod_HMAC_SHA1()
# REQUEST
resp, content = request(REQUEST_TOKEN_URL, params={},
consumer=consumer, token=None) <----
Valeu,
Marcel