Jump to content
Sign in to follow this  
frontmill

HTTP 302 return code

Recommended Posts

frontmill

I am using the http.au3 udf. I am trying to connect and login to rapidshare.com, but when i run this script i get a 302 response. Which is "Moved temporarily". This is the response i received:

Example POST Request:

Socket Created: 1816

Bytes sent: 229

HTTP Return Code: 302

HTTP Return Response: Moved Temporarily

Number of headers: 6

Size of data downloaded: 0 bytes

Page downloaded:

I hope someone can help me solving this!

Thanks in advance!

#include <Http.au3>

$host = "ssl.rapidshare.com"
$page = "/cgi-bin/premiumzone.cgi"
$vars = "login=******&password=******"
$vars = _HTTPEncodeString($vars)

ConsoleWrite(@CRLF&@CRLF&"Example POST Request:"&@CRLF)
$socket = _HTTPConnect("ssl.rapidshare.com",443)
ConsoleWrite("Socket Created: "&$socket&@CRLF)
$get = _HTTPPost($host, $page, $socket, $vars)
ConsoleWrite("Bytes sent: "&$get&@CRLF)
$recv = _HTTPRead($socket,1)
If @error Then
    ConsoleWrite("_HTTPRead Error: "&@error&@CRLF)
    ConsoleWrite("_HTTPRead Return Value: "&$recv &@CRLF)
Else
    ConsoleWrite("HTTP Return Code: "&$recv[0]&@CRLF)
    ConsoleWrite("HTTP Return Response: "&$recv[1]&@CRLF)
    ConsoleWrite("Number of headers: "&UBound($recv[3])&@CRLF)
    ConsoleWrite("Size of data downloaded: "&StringLen($recv[4])&" bytes"&@CRLF)
    ConsoleWrite("Page downloaded: "&@CRLF&$recv[4]&@CRLF)
EndIf

_HTTPClose($socket)

Share this post


Link to post
Share on other sites
/dev/null

I am using the http.au3 udf. I am trying to connect and login to rapidshare.com, but when i run this script i get a 302 response. Which is "Moved temporarily". This is the response i received:

I hope someone can help me solving this!

Thanks in advance!

two problems:

1.) I think your login data is incorrect, that's why you get a "302 Moved Temporarily". The webserver just directs you back to the login page. As I don't have a login I cannot test.

2.) There is most certainly a bug in http.au3, starting at line 280. It does not handle the return codes of the server properly. It cut's off the relevant HTTP headers, as StringRegExp() works different now. The code in http.au3 just checks @extended and NOT @error, which is for sure wrong.

So, no easy solution for your problem... Either contact the author of http.au3 to fix the bug, or have a look at the _IE* functions.

Cheers

Kurt


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites
GtaSpider

Hi

Anything happend here?

Wanna do the same as frontmill.

It works glad with IE functions, but I hate to open the IE for that.

(It took too long and some user hasnt got the IE)

your Spider


www.AutoIt.de - Moderator of theĀ German AutoIt Froum

Share this post


Link to post
Share on other sites
Richard Robertson

Anyone using AutoIt correctly has Internet Explorer installed.

Share this post


Link to post
Share on other sites
redblacktree

Anyone using AutoIt correctly has Internet Explorer installed.

This is an interesting claim. Care to explain?

redblacktree

Share this post


Link to post
Share on other sites
DW1

I can only speculate as I cannot speak for Richard Robertson, but I assume he is referring to the fact there are built in IE functions but no functions for other browsers, as they either do not have a com object or do not have a UDF for the object.

Share this post


Link to post
Share on other sites
Richard Robertson

No, I was referring to AutoIt being a Windows program and Windows coming with Internet Explorer. Since Internet Explorer is installed, the COM object is available.

As for the UDF, once you compile it, the scripts available on the end computer don't have any influence.

Share this post


Link to post
Share on other sites
redblacktree

What I don't understand is how you could use AutoIt "incorrectly" by not having IE installed. I know that IE is deeply integrated in Windows, but isn't it possible to "uninstall" it? At least, to a degree?

I guess if I uninstall IE and proceed to use AutoIt, I am doing something incorrectly?

redblacktree

Share this post


Link to post
Share on other sites
Richard Robertson

I'm talking about people who use AutoIt on Wine (Linux).

Share this post


Link to post
Share on other sites
GtaSpider

Hi

However.. dont wanna use IE (too slow, too unsecure, ..) Has anyone a Idea?

Spider


www.AutoIt.de - Moderator of theĀ German AutoIt Froum

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×