خرید بک لینک

Vote count: 0

I want to use smartystreets via python.

here is the script I am using:

# ss.py

import requests
import pdb

authid   = 'jaf110af-b6ae-3ea2-829a-035dcb246392'
token    = 'kAyGAA0rD0lNykcktJpg'
payload2 = {'auth-id':authid, 'auth-token':token}
add_s    = '1600+Amphitheatre+Parkway,+Mountain+View,+CA'
site2    = 'https://api.smartystreets.com/'+add_s

req2 = requests.get(site2,params=payload2)

pdb.set_trace()

req2.status_code
#req2.json()
req2.text
'bye'

The API server is issuing a 404.

So perhaps I have a syntax error.

Please help me understand how to debug my API calls to the API server.

Here is some info about my setup:

dan@h81:~/ks/c/lodgiq $ python
Python 3.5.1 |Anaconda 4.0.0 (64-bit)| (default, Dec  7 2015, 11:16:01) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 
>>> 
dan@h81:~/ks/c/lodgiq $ 
dan@h81:~/ks/c/lodgiq $ 
dan@h81:~/ks/c/lodgiq $ python ss.py 
> /home/dan/ks/c/lodgiq/ss.py(16)<module>()
-> req2.status_code
(Pdb) req2.status_code
404
(Pdb) 

asked 31 secs ago

برچسب: نویسنده: استخدام کار تاريخ: پنجشنبه 12 فروردين 1395 ساعت: 7:36

صفحه بندی