Tag Info

Hot answers tagged

10

Just wanted to let everybody know that I just made a new release of the library here. This release includes tons of bug fixes as well as some breaking changes which shouldn't be a problem if you have been running off the trunk. Also, by popular demand, I added a .Net 3.5 version of the library to this release. The hope here is to eventually have a mono ...


9

This is a take on a class that has been floating around for a while. I first saw it in kevin's first api. You can use this on all values that are declared as 'unix timestamp', both request and response ///<summary> ///</summary> public static class UnixDateTimeHelper { private const string InvalidUnixEpochErrorMessage = ...


7

You are getting the GZipped stream of the response content. Use DownloadData instead of DownloadString and uncompress the stream before passing it to the JSON deserializer (or whatever you plan to use). Alternatively, you can use the StackOverflow.Net library.


4

All responses from the API are compressed. You can specify the compression scheme (gzip or deflate) in the Accept-Encoding header. If you don't specify, one will be chosen for you. We used to throw up an error when a non-compressed request was received, but a frustrating number of proxies don't pass Accept-Encoding through properly; so instead we silently ...


4

As I learned from George Edison in his comment, the server handles time in UTC format. Just replace your calls to DateTime.Now with DateTime.UtcNow or you can convert any DateTime to UTC format with the ToUniversalTime method. Just make sure not to call ToUniversalTime on the server's time, or it'll get messed up.


3

Are you by any chance using POST? For 1.0 this works. But not for 1.1 (though GET works fine for both 1.0 and 1.1). (I have no idea if it should work though.)


3

With the way the API is currently set up (lots of caching the info page says) is it possible to update the information on a question you've already looked at? I have a list of questions but, as time goes on, the information changes (# of answers, votes, etc) and I would like to be able to update the questions with the new info.


2

The following is simply my opinion so take it for what is is worth: Whenever I see a LINQ provider built on top of a service, I become very interested to know how and when it is actually executing queries and if the abstraction is really saving me anything. For example the statment: var users = ctx.Sites("api.stackoverflow.com") ...


2

Event Logging, Caching and Throttling I've just finished implementing these features. Event Logging is a new feature that allows us to debug different methods on the bridge by hooking the events at client.EventLog, and examining the messages logged there. Caching was already present on the previous version of the bridge, but it now supports ...


2

You're treating the response as a UTF-8 encoded string. That's bound to fail with binary data like GZip. A quick fix is to use Encoding.GetEncoding("iso-8859-1") instead of UTF8 in StringToByteArray, and also pass this encoding to the StreamReader constructor in FetchURL. That encoding maps bytes to codepoints one-to-one; see this answer on Stack Overflow. ...


1

string post_data = "client_id={0}&client_secret={1}&code={2}&redirect_uri={3}"; post_data = string.Format(post_data, code, clientId, redirect_url, apiSecret); Shouldn't that be string post_data = "client_id={0}&client_secret={1}&code={2}&redirect_uri={3}"; post_data = string.Format(post_data, clientId, apiSecret, code, ...


1

I have not tried Stacky in Azure so I can't really comment from experience on that. I can say that the problem doesn't appear to be the assembly not being there. If, for example, the newtonsoft assembly was missing you would be getting an exception like: System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=3.5.0.0, ...


1

In the StackyClient.GetQuestions function, for the tags parameter, will you get questions with any of the tags in the array, or questions that have all of the tags in the array? Also I don't see really any documentation except for the page with a few examples, which don't explain what exactly the parameters do and stuff. If anyone could link me to a ...


1

Thanks for this super library! I've used it for overflow 7 - http://bit.ly/overflow7 I've put a few detailed comments on the codeplex discussion site - http://stacky.codeplex.com/Thread/View.aspx?ThreadId=242369 - hope these help. Thanks again Stuart



Only top voted, non community-wiki answers of a minimum length are eligible