The differences between "+" are "%20" are subtle.

When you are using + instead, it *should* still work as long as + is
represented in your signature base string as: %2B

Are you able to see what + yields in your signature base string?

A little background on the difference between + and %20 in URLs...

"+" only means space in a URL when in the context of a field name or field
value -- otherwise, within a URL it's literally a plus.. for this reason,
it's a best practice to always be clear with intent. Use + when you mean
plus in a URL component that is not a key/value pair, use %2B when you
literally mean "+" in a string, and always use %20 when you mean a "space"
within a string.

Ideally, a web server will consider %20 and + within the context of a URL
value the same -- but this gets complicated by OAuth when calculating
signature verification -- you don't want to be "fuzzy" on what you consider
is valid or not.

Taylor

On Fri, Nov 12, 2010 at 3:31 PM, dan <dfran...@gmail.com> wrote:

> By ui-encoding you mean percent-encoding?
>
> On Nov 10, 3:38 am, Ciaran <ciar...@gmail.com> wrote:
> > Try ui-encoding them first, my understanding of the Twitter OAuth
> > signature validation is that it is non-standard (although there
> > appears to be debate about this) I suspect if you encode them first
> > before signing the url it will start to work
> > -cj.
> >
> > On Tue, Nov 9, 2010 at 6:11 PM, dan <dfran...@gmail.com> wrote:
> > > I've been having trouble connecting to the streaming API using oauth
> > > if my tracks have spaces. I get 401s (unauthorized). In all cases, the
> > > same code works if the tracks don't have spaces.
> >
> > > In Java: tried twitter4j (http://twitter4j.org/jira/browse/TFJ-420)
> > > and tweetstream4j (http://stackoverflow.com/questions/4129622/
> > > connecting-to-twitter-streaming-api-with-tracks-with-spaces-using-
> > > apache-httpclie)
> >
> > > In Python: tried tweepy (https://github.com/joshthecoder/tweepy/
> > > issues#issue/64)
> >
> > > The Twitter example using curl (http://dev.twitter.com/pages/
> > > streaming_api_methods#track) works with tracks that have spaces, but
> > > it's basic auth.
> >
> > > I am wondering if some oauth encoding versus POST param encoding is
> > > not working out.
> >
> > > Can someone point me to a code example in Java or Python that is known
> > > to work connecting to the Twitter streaming API using oauth that has
> > > spaces in its tracks?
> >
> > > Thanks in advance.
> >
> > > --
> > > Twitter developer documentation and resources:
> http://dev.twitter.com/doc
> > > API updates via Twitter:http://twitter.com/twitterapi
> > > Issues/Enhancements Tracker:
> http://code.google.com/p/twitter-api/issues/list
> > > Change your membership to this group:
> http://groups.google.com/group/twitter-development-talk
>
> --
> Twitter developer documentation and resources: http://dev.twitter.com/doc
> API updates via Twitter: http://twitter.com/twitterapi
> Issues/Enhancements Tracker:
> http://code.google.com/p/twitter-api/issues/list
> Change your membership to this group:
> http://groups.google.com/group/twitter-development-talk
>

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk

Reply via email to