These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

Having problem getting endpoints from Auth Crest (C#)

Author
Bill Loomis
Tritanium Alots
#1 - 2015-06-09 14:51:49 UTC
I've gotten to the point where I've got an access token but whenever I make the request to get the endpoint list I get 400 Bad Request error. I've tried several variations of the header but can't seem to put my finger on my mistake. If any of you experts out there have a moment would you take look at this snippet and let me know if you see the problem?

HttpWebRequest request = WebRequest.CreateHttp( "https://crest-tq.eveonline.com/" );
request.Proxy = null;
//request.ContentType = "application/x-www-form-urlencoded";
request.Method = "POST";
request.Headers.Add( "Authorization", "Bearer " + _accessToken );
//request.Accept = "application/vnd.ccp.eve.Api-v3+json; charset=utf-8";
request.Host = "crest-tq.eveonline.com";
request.ContentLength = 0;

var response = request.GetResponse();

Another thing that I'm not clear on; when I verify the auth code I get an access token but not a refresh token. Furthermore it seems the access token expires after a few minutes, forcing me to start over. This doesn't seem to be working as intended so I figure I must be not catching on to something. Can anyone offer any guidance on this?

Thanks for any help :)
Jack Tronic
borkedLabs
#2 - 2015-06-09 17:03:45 UTC  |  Edited by: Jack Tronic
You have to GET the endpoint list not POST.

You may be better off using an existing library like this one seeing how you don't even know HTTP basics :/
https://github.com/ezet/evelib