Bad Auth Key in C# client

7 views
Skip to first unread message

Rich

unread,
Jan 21, 2009, 12:07:28 PM1/21/09
to Pikchur API
Hey Peter.

To respond to your email, I don't believe it is an issue with the
methods I'm using. I am sending three requests, and the other two are
just fine. I'm not using any fancy 3rd party libraries either, so I
can for the most part see all of the code being executed. Also, I'm
sending the first request (auth) over https and I'm getting back valid
xml, so I don't think there's any issue with either protocol. The
return I get from auth is valid xml, and I'm trimming a line feed off
of either end of the auth_key value (the raw string value of the
element has \n before and after the auth key). I tried this with and
without trimming the string.

I call auth over https with the req'd params, and I get back valid xml
with an auth_key element.
I then call get "01" over http with the req'd params (does not require
auth_key), and I get back valid xml with the expected data for my
particular account.
I then call get "02" over http with the req'd params including
auth_key, and I get the error I sent you (wrapped in an xml
structure).

All three calls are basically using the same utility methods (that I
created...not a library) that build the post string and encode it into
an ASCII byte array. All three calls also post the data by calling
the exact same method that sets the http method to "POST" and the
content type header to "application/x-www-form-urlencoded" and then
sends the post data as an array of bytes (which as you can see from
the proxy screenshots end up on the server as plain text, and is also
why the first two calls are able to succeed).

The only thing on my end that I can see being an issue is that somehow
the actual auth_key itself might be getting lost in translation?
Could there be a Unix-specific escape sequence that my windows app is
choking on? Could there be some kind of character conversion going on
that I'm not handling? Other than that, I'd have to assume that it's
on your side. If I were improperly building the request or improperly
encoding the post data, all three calls would have failed.

Let me know if you need any more info. I wrote this little piece of
code inside of a .Net 3.5 SP1 WPF app, but if you have a windows
machine with an older copy of Visual Studio, I can easily downgrade it
really quickly and send it to you.

- Rich
Reply all
Reply to author
Forward
0 new messages