Skip to content

Instantly share code, notes, and snippets.

@kballenegger
Created August 19, 2014 23:31
Show Gist options
  • Save kballenegger/12891782ef4ed129ef6a to your computer and use it in GitHub Desktop.
Save kballenegger/12891782ef4ed129ef6a to your computer and use it in GitHub Desktop.
Validate addresses automatically via SmartyStreets
POST /bill-pay/payees HTTP/1.1
Accept: application/json
Accept-Encoding: gzip, deflate, compress
Content-Length: 63
Content-Type: application/json; charset=utf-8
FreshPay-Authentication: eyJ1c2VyIjo5MjcyNDQ2MDI1MDQ2NTk0MTQsInRpbWUiOjE0MDU5NDk5NDMsInBlcm1pc3Npb25zIjoiYWxsIiwiYXBwIjoiZnJlc2hwYXktd2ViIn0AB4FBJshQOd19bzDkwG9k3xscgASv9vOPSBRldfSuTzU=
Host: localhost:9977
User-Agent: HTTPie/0.4.0
{
"address": "353 king st sf ca",
"name": "Kenneth Ballenegger"
}
HTTP/1.1 400 Bad Request
Connection: close
Content-Type: application/json
Server: thin 1.5.1 codename Straight Razor
{
"failures": [
{
"address": [
"was not a deliverable address. suggestions:",
[
{
"city": "San Francisco",
"country": "US",
"state": "CA",
"street": "353 King St",
"zip": "94158-1675"
}
]
]
}
],
"message": "Invalid input.",
"status": 400
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment