stavo cercando di fare LINK FINDER e fronte 2 problemaasincrono HttpRequest utilizzando WinHttp.WinHttpRequest.5.1 in ASP
Issue 1 (Risolto) :: Impossibile ottenere l'URL della pagina reindirizzata
Questo è stato risolto REFERNCE LINK utilizzando WinHttp.WinHttpRequest.5.1
Issue 2 (Unsolved) :: in grado di utilizzare WinHttp.WinHttpRequ est.5.1 opporsi EVENTI o nessuna richiamata alla richiesta asincrona
richiesta codice sincrono
Set req = CreateObject("WinHttp.WinHttpRequest.5.1")
req.open "GET", url, FALSE
req.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
req.send PostData
Questo sta lavorando bene ma se devo richiesta multuple, allora la sua assunzione a molto tempo.
ho cercato seguente Asynchronous codice di richiesta ma ottenere errore
Set req = CreateObject("WinHttp.WinHttpRequest.5.1")
req.open "GET", url, TRUE
req.OnReadyStateChange = GetRef("req_OnReadyStateChange")
req.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
req.send PostData
Function req_OnReadyStateChange
' do something
End Function
Codice 1
Set req = CreateObject("WinHttp.WinHttpRequest.5.1","req_")
req.open "GET", url, TRUE
Function req__OnResponseFinished
' do something
End Function
req.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
req.send PostData
ERRORE - Il computer server remoto non esiste o non è disponibile : 'CreateObject'
Codice 2
Set req = CreateObject("WinHttp.WinHttpRequest.5.1")
req.open "GET", url, TRUE
req.OnResponseFinished = GetRef("req_OnResponseFinished")
Function req_OnResponseFinished
' do something
End Function
req.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
req.send PostData
ERRORE: L'oggetto non supporta questa proprietà o metodo: 'req.OnResponseFinished
Codice 3
Set req = CreateObject("WinHttp.WinHttpRequest.5.1")
req.open "GET", url, TRUE
req.OnReadyStateChange = GetRef("req_OnReadyStateChange")
req.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
req.send PostData
Function req_OnReadyStateChange
' do something
End Function
Nella documentazione microsoft, hanno fatto riferimento a WinHttp.WinHttpRequest.5.1 hanno 4 eventi.
- OnError
- OnResponseDataAvailable
- OnResponseFinished
- OnResponseStart
ma non ho ottenuto esempio di come utilizzare questo evento, non sono in grado di utilizzare questi eventi in ASP.
Speranza per una risposta rapida ...
Sì, ho bisogno di URL finale dopo i thats di reindirizzamento per questo che sto usando WinHttp.WinHttpRequest.5.1. per ulteriori informazioni è possibile controllare http://stackoverflow.com/questions/20358654/serverxmlhttp-request-returing-data-but-not-returning-url-of-final-page-after-30 –
@Dr_Dang ok e hai provato a utilizzare una Sub invece di una funzione per l'evento OnReadyStateChange? – ulluoink