HTTPSocket url is not well-formed

I’m attempting to access a web service using oAuth & am getting the exception URL is not well formed when trying to post. Using the same generated URL in Safari on the simulator does work. Anybody got any idea?

The url is https://api.xero.com/api.xro/2.0/Organisation?oauth_consumer_key=DNA8KY3OIUQBIAR7EDCMB726Y5RXCU&oauth_nonce=6C89DC61430ED4B6&oauth_signature_method=RSA-SHA1&oauth_timestamp=1429562124&oauth_token=DNA8KY3OIUQBIAR7EDCMB726Y5RXCU&oauth_version=1.0&oauth_signature=w4dRwqfDr2pRw5N2NCVVD3VPYyvDpMKHXVXCrcKUR8OBwo3Cm8OlFcOnwrlUwq1u
f8OqRWLDqxrDuAQFacKuScO9XsKfw4cpYsO1w65tbsOhw5A0w6DDtzLCpMKTbFTD
hMKewqJ7HwfCkcKzNj8eF8OiwovCjlYWwo%2fDszkgwpdLKcOkNcOUSEMyFT3DlsKZ
dwbDrC7CssKKU8KXf8OSGizCqMOjLMKsQAoVKyNOwq4mQsOswpNswoc%3d

It’s about time somebody made the Xero app more useful, Wayne… :wink:

(Sorry I can’t actually help with your issue)

Did you check that your URL doesn’t actually contain line breaks? It looks like the signature has line breaks in it.

No line breaks, works when pasted into safari.

Wayne,

Have you tried a product like Paw for testing your API calls? Something like that may help you narrow down errors like this. The reason I ask is that safari may not use NSURLConnection, so the results wouldn’t be the same as httpsocket. It would certainly help us narrow it down.

I am using the new http socket on Windows without problem. If I get an OSX version working will that help?

Most likely. The error you are getting could simply be that the server doesn’t accept HTTP/1.0 requests. The new sockets support 1.1 and beyond.