0

Okay, so I'm having an issue with my application... Now I'm getting the following:

The remote server returned an error: (400) Bad Request.

Fixed the uri, now I'm getting an invalid Token error, am I getting my token incorrectly? Also I would like to make it a session token instead of single use?


The Token is an example Token, I've tried it with and without the 1% in the front of it. I use this link to get my Token:

https://accounts.google.com/b/0/AuthSubRequest?next=http%3A%2F%2Fwww.example.com%2Fupload.html&scope=http%3A%2F%2Fgdata.youtube.com&session=0+&secure=0


The key is taken directly from my Google Code and I know it works.

Here's a link to my code.

http://pastebin.com/Ufx94gcQ

SWB
  • 24
  • 3

1 Answers1

0

In your code I don't see you send the request at all. Calling GetResponse() will send the request and make it possible to access the response. You can find an example on MSDN

Pawel
  • 31,342
  • 4
  • 73
  • 104
  • Alright, updated my code, getting this error now ^^^ – SWB Mar 02 '15 at 21:30
  • Should I create a new post and link this one as solved, or would you be willing to help? – SWB Mar 02 '15 at 21:55
  • It seems that the 1%2F bit, is always the same, removed that same issue: token=1%2FwmJDQLK6IH56kj2YhUf9C83tdEDRVxXvrQ_XjXk39i190RDknAdJa_sgfheVM0XT – SWB Mar 02 '15 at 22:02
  • 400 oftentimes means your request did not have something the other side expected and in this case it depends on the service you are connecting to. I would look at headers. If you have a way to make a successful request (e.g. sending a request manually from the browser) use Fiddler to see what is being sent and then try to exactly replicate this request in your code. – Pawel Mar 03 '15 at 17:33