A
A
Artyom2019-01-27 12:16:34
VBScript
Artyom, 2019-01-27 12:16:34

Why is vbs access denied on get request?

Hello, I wrote such a script that reads information in txt from the site and returns it in the http.responseText variable
There is a regular link in the file itself.
Then I form a new get request and substitute the http.responseText variable instead of the URL - logically, I should follow the link from the file (more precisely, send a get), but for some reason I get an "access denied" error on the second get, although in the MsgBox the http.responseText variable clearly shows the link written in the txt file
URL=" rgho.st/download/7VpxTWRd2/184281bef8df917a0f05581... "
Set WshShell = WScript.CreateObject("WScript.Shell")
Set http = CreateObject("Microsoft.XmlHttp")
http.open "GET", URL, False 'open txt with link
http.send ""
MsgBox http.responseText 'make sure we got the contents of the file (our link)
http.open "GET", http.responseText , False ' substitute our value for the link for the get request
http.send ""
if err.Number = 0 Then
End If
set WshShell = Nothing
Set http = Nothing

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question