![]() |
|
[C#] What's wrong with my HttpWebRequests? - 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: [C#] What's wrong with my HttpWebRequests? (/showthread.php?tid=5283728) |
What's wrong with my HttpWebRequests? - fortress1999 - May 27, 2016 Code HttpWebRequest peticionGalleta = (HttpWebRequest)WebRequest.Create("twitter.com/sessions");The messagebox doesn't display anything (The links are fine, I just can't post them fully on HF) * - Sakuto - May 27, 2016 I'm not dealing with this kind of method, but, isn't it an async method? * - fortress1999 - May 27, 2016 (May 27, 2016 11:32 AM)Sakuto Wrote: I'm not dealing with this kind of method, but, isn't it an async method? Hey man its a spanish website that tought people on how to do it, not sure if its the best way, where and how do u think I should learn? I wanna make bots for twitter... Thanks🤝 * - 0xDEAD10CC - May 27, 2016 (May 27, 2016 11:32 AM)Sakuto Wrote: I'm not dealing with this kind of method, but, isn't it an async method? Nothing in his code is asynchronous at all. But why do you have a GET variable that isn't assigned? Code &redirect_after_login=And why are you hardcoding ContentLength as 238? Code peticionGalleta.ContentLength = 238;^ You have no idea the length of the textbox inputs at compile time, so that is silly... :S You don't know what you're doing and once you get into authentication you'll be lost. * - +Haze - May 27, 2016 Yes DeadLock is right, well other than whyen he said it was GET variables. It's a POST variable since the method is POST. Also op, don't set the content length, the webrequest will set it for you automatically after you write the data to the request stream. Also, the main reason yours isn't working is because you most likely haven't made an initial request to gather the session cookies. Which you should include in the subsequent request. * - 0xDEAD10CC - May 27, 2016 Ahh, I got threads mixed up. Was reading another one where some guy wanted to send a bunch of threaded GET requests in C. * - fortress1999 - May 28, 2016 (May 27, 2016 03:12 PM)+Haze Wrote: Yes DeadLock is right, well other than whyen he said it was GET variables. It's a POST variable since the method is POST. Where do you think I should learn about HttpWebRequests? Thanks * - 0xDEAD10CC - May 28, 2016 First you have to understand HTTP. From there it should be fairly easy to learn the .NET classes. |