Sparticuz / usps-webtools-promise

USPS Web Tools API wrapper
14 stars 4 forks source link

API URL error #3

Closed jgarcia24n closed 3 years ago

jgarcia24n commented 4 years ago

Request URL is showing https://secure.shippingapis.comshippingapi.dll causing error net::ERR_NAME_NOT_RESOLVED. I was able to fix it by adding a "/" to path in request.js. path: "/ShippingAPI.dll?${qs}"

Also on your example usps.verify({ Address1: '322 3rd st.', Address2: 'Apt 2', City: 'San Francisco', State: 'CA', Zip: '94103' }).then(address => { console.log(address); }); You have Zip but it only accepts Zip5 and Zip4 Options, This one is no big deal just letting you know.

@Sparticuz Thanks for updating and adding promises

Sparticuz commented 4 years ago

Ah thanks for letting me know. I'll fix the Zip. (I moved from using Zip to just parsing out Zip4 and Zip5 in the last version).

Interesting on the slash, I'm not seeing the same problem, what version of node are you using? https://github.com/Sparticuz/usps-webtools-promise/blob/eed6f878b6fbd0edc66160f25597a8642d899865/src/utils/request.ts#L111

jgarcia24n commented 4 years ago

I'm currently using node v12.8.1. I think I have always used a slash on path when using https.request

nathanaelphilip commented 3 years ago

I received the same error. I’m on node v 13.13.0 – what’s the recommended version?

Thank you for rewriting this – it’s a wonderful package.

Sparticuz commented 3 years ago

It is tested on 10, 12, and 14. I just rebuilt my PC, so I haven't had time to redo my dev environment. I will definitely get to this soon though.