![]() |
|
[.NET] Http Synchronous Class - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [.NET] Http Synchronous Class (/showthread.php?tid=4626421) |
Http Synchronous Class - DBots - Jan 8, 2015 I started a small project today which is a wrapper for the HttpWebRequest/HttpWebResponse synchronous methods. I kept it very basic because I wanted it to be easy to use without having so many variables etc. so pretty much the guidelines I kept were: 1. Did the request go through fine? -If yes, work with the response. 2.If the request errored, was it a timeout? -If so, change proxy, etc, and reissue the request. -If not, check the exception or log it, or change proxy, etc, and reissue the request. This is the code that I use to send and receive a request: PHP Code Now as you can see HttpRequest.Get/Post are shared functions which take in ClientProperties byref. Is it bad practice to pass byref on a shared function? Is this even threadsafe? Here is the code for the classes: http://pastebin.com/GwaysRUn * - idb. - Jan 8, 2015 (Jan 8, 2015 09:34 AM)DBots Wrote: I started a small project today which is a wrapper for the HttpWebRequest/HttpWebResponse synchronous methods. Some of this code seems strangely familiar. 😠 * - Only3 - Jan 8, 2015 (Jan 8, 2015 09:39 AM)idb. Wrote: Some of this code seems strangely familiar. 😠 😁 also this code seems shortly * - DBots - Jan 8, 2015 (Jan 8, 2015 09:39 AM)idb. Wrote: Some of this code seems strangely familiar. 😠 If you're insinuating I took code from your class and slapped it into mine then you're dead wrong mister. In that case I wouldn't post it here where I know you are a member and can easily call me out for it. I'd probably have gone asked in stackoverflow or something. (Jan 8, 2015 09:49 AM)Only3 Wrote: 😁 also this code seems shortly Meaning..? If you're being sarcastic then well the classes are not short but it would be a compiled dll which would make the usage code short. At least that was the idea. Also, @idb, which part do you think I copied or what? Forgot to say, I probably should have made HttpRequest MustInherit since it's unusable on it's own. Anyone else have any USEFUL replies? * - Only3 - Jan 8, 2015 😁 it wasnt for u meaning its shoreter then idb * - Tedd - Jan 8, 2015 (Jan 8, 2015 10:14 AM)Only3 Wrote: 😁 it wasnt for u meaning its shoreter then idb This guy is like either 12 or foreign. He means that your code is "shorter" than idb's, as in it's either less extensive or that you copied some of idb so obviously your code would be shorter than his. * - DBots - Jan 9, 2015 (Jan 8, 2015 12:26 PM)Tedd Wrote: This guy is like either 12 or foreign. I guess the only way to know is to compare them side by side. My source is there so I have nothing to hide. I actually coded this in terms of easy usage as i mentioned before. So believe it or not, I started with the code in terms of usage and then went on to the implementation which are those classes linked. My original question though, was: HttpRequest.Get/Post are shared functions which take in ClientProperties byref and make changes to it. Is it bad practice to pass byref on a shared function? Is this even threadsafe? * - ByKemal - Jun 10, 2016 thanks, but do not working pastebin link? Can you re-upload pastebin? * - Ninja - Jun 10, 2016 This just looks like a normal HttpWebRequest to me... EDIT: Is this asynchronous or synchronous? |