Post/get HTTP requests in VB.net

April 9, 2010 at 14:24:23
Specs: Windows Vista
I'm trying to post information to a website, login, and then
send a request with specific variables. I'm finding it really
difficult to get information on how to do any of these things in
vb.net so I'd really appreciate it if someone could point me in
the right direction.

Also, here's the php scrip I'm trying to emulate in vb.net.

require_once "HTTP/Request.php";

$req = &new HTTP_Request('https://steamcommunity.com');
$req->setMethod(HTTP_REQUEST_METHOD_POST);

$req->addPostData("action", "doLogin");
$req->addPostData("goto", "");

$req->addPostData("steamAccountName", ACC_NAME);
$req->addPostData("steamPassword", ACC_PASS);

echo "Login: ";

$res = $req->sendRequest();
if (PEAR::isError($res))
die($res->getMessage());

$cookies = $req->getResponseCookies();
if ( !$cookies )
die("fail!\n");

echo "ok\n";

foreach($cookies as $cookie)
$req->addCookie($cookie['name'],$cookie['value']);

$mid = GetFriendID(MY_STEAM_ID);
$fid = GetFriendID($invite_steam_id);
$url = "
http://steamcommunity.com/actions/G...
type=groupInvite&inviter=$mid&invitee=$fid&group="
. GROUP_ID;

echo "Inviting $invite_steam_id ($fid): ";
$req->setMethod(HTTP_REQUEST_METHOD_GET);
$req->setUrl($url);

$res = $req->sendRequest();
if (PEAR::isError($res))
die($res->getMessage());


See More: Post/get HTTP requests in VB.net

Report •


#1
April 11, 2010 at 12:06:41
The class you want to look at is System.Web.HttpRequest.

Report •

#2
April 11, 2010 at 15:29:05
What declarations do I need to include?

I've got Imports System.Web but I just get errors when I try and
use System.Web.HttpRequest.


Report •
Related Solutions


Ask Question