I'm trying to call the Yahoo BOSS API with some query strings as detailed here. Things work fine unless there's a space in the query. I'm encoding the query string using URLEncoder.encode(q, "UTF-8")
.
But as soon as there's a white space in the query string, the request fails with a Please provide valid credentials. OAuth oauth_problem="signature_invalid"
error. Since the query string is encoded, the white space should be escaped, has anyone else faced and solved this issue before?
I had the exact same problem. You need to use:
Your version is breaking your signature because Oauth uses percent encoding to sign the request. So you'll need the
%20
. A good article on that topic can be found here.