Created
November 16, 2019 18:09
-
-
Save argrath/cd73225417f926ad6214f9905ed6714a to your computer and use it in GitHub Desktop.
Win32::Internetでhttpsアクセスするテスト。httpでアクセスしてもhttpsにリダイレクトするサイトならこのままで動く?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use Win32::Internet; | |
my $REQ; | |
my $HTTP; | |
my $INET = new Win32::Internet(); | |
$INET->HTTP($HTTP, "gmail.com"); | |
$HTTP->OpenRequest($REQ, "/"); | |
$REQ->AddHeader("If-Modified-Since: Saturday, 16-Nov-96 15:58:50 GMT"); | |
$REQ->SendRequest(); | |
my $statuscode = $REQ->QueryInfo("",HTTP_QUERY_STATUS_CODE); | |
my $lastmodified = $REQ->QueryInfo("Last-Modified"); | |
my $file = $REQ->ReadEntireFile(); | |
$REQ->Close(); | |
$HTTP->Close(); | |
print $file; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment