简体   繁体   English

使用HttpClient实现发布/获取请求

[英]Post/Get requests using HttpClient implementation

I'm trying to make a bot for a browser game, i'm really passionate about this project and i have thought about the model and everything but when i wanted to actually implement it i got lost, i know it's all about post/get requests and i watched the HTTP headers using firefox plugin and i kinda get the idea of how things works when i make an action in the game. 我正在尝试为浏览器游戏制作机器人,我对这个项目真的很感兴趣,并且我已经考虑过模型和所有东西,但是当我想真正实现它时,我迷路了,我知道这全都与发布/获取有关请求,我使用firefox插件观看了HTTP标头,然后我就对在游戏中进行操作时的工作原理有了一个了解。

my question is, how can i make an HTTP post request with given info ( username + password to star with ) , that logs me into the game, and then get info ( resources for instance ) of the first page maybe? 我的问题是,我该如何使用给定的信息(用户名+密码加上星号)发出HTTP发布请求,使我登录游戏,然后获取首页的信息(例如资源)?

if i can just get past that point i'll progress, i'm really stuck. 如果我能超越那一点,我会进步的,我真的很困。

thanks. 谢谢。

I advise you to use fiddler( http://www.telerik.com/fiddler ) to capture all the requests and then you could try to do the same using HttpClient or even HttpRequest. 我建议您使用fiddler( http://www.telerik.com/fiddler )捕获所有请求,然后尝试使用HttpClient甚至HttpRequest进行相同的操作。

Your bot should be able to make the same requests to the server as your browser do. 您的机器人应该能够像浏览器一样向服务器发出相同的请求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM