Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7904961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T10:17:11+00:00 2026-06-03T10:17:11+00:00

I am trying to use python for address verification using CDYNE service. I used

  • 0

I am trying to use python for address verification using CDYNE service.

I used this as reference to create POST request and it looks like following

import urllib2
import urllib

url = 'http://pav3.cdyne.com/PavService.svc/VerifyAddressAdvanced'
data = {}

data['CityName'] = 'San Francisco'
data['FirmOrRecipient'] = 'CDYNE'
data['LicenseKey'] = 'valid_key'
data['PrimaryAddressLine'] = '45 fremont street'
data['ReturnCaseSensitive'] = True
data['ReturnCensusInfo'] = True
data['ReturnCityAbbreviation'] = True
data['ReturnGeoLocation'] = True
data['ReturnLegislativeInfo'] = True
data['ReturnMailingIndustryInfo'] = True
data['ReturnResidentialIndicator'] = True
data['ReturnStreetAbbreviated'] = True
data['SecondaryAddressLine'] = ''
data['State'] = 'CA'
data['Urbanization'] = ''
data['ZipCode'] = '94105'  

and post the request as following

data_encoded = urllib.urlencode(data)
req = urllib2.Request(url, data_encoded)
response = urllib2.urlopen(req)  

I see error as

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 398, in open
    response = meth(req, response)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 511, in http_response
    'http', request, response, code, msg, hdrs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 436, in error
    return self._call_chain(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 370, in _call_chain
    result = func(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 519, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 400: Bad Request  

I am new to this so don’t understand what has gone wrong, please help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T10:17:12+00:00Added an answer on June 3, 2026 at 10:17 am

    you either have to send the request as json or xml formatted document, the schema is on the page you’ve linked to.
    you’re sending an urlencoded request, which isn’t supported by the api.

    edit: that’s how it would look like using JSON:

    import json
    data_encoded = json.dumps(data)
    req = urllib2.Request(url, data_encoded, {'Content-Type': 'application/json'})
    response = urllib2.urlopen(req)
    print response.read()
    # ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use python to login to this page(which i own!) http://ninitelist.yolasite.com/passprotected.php
I'm trying to use python's Template object to create html emails. However, when the
I already have python 2.7 (installed using activepython). I'm trying to use python 3.2
I am trying to use python's imaplib to create an email and send it
I'm trying to use python to parse a log file and match 4 pieces
I am trying to use Python's ElementTree to generate an XHTML file. However, the
I am trying to use Python to resize picture. With my camera, files are
I'm trying to use Python to run pdftotext, but for some reason, my code
I'm trying to use Python 2.7 regex's to retrieve data from sample web pages
I am trying to use python socket instead of netcat to send metric data

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.