import(net.http)

path.exists('proxy_setting.az') && import(proxy_setting)

net.http.client('www.nifty.com') {|c|
	resp = c.get('/',
		'Accept'			=> 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
		'Accept-Charset'	=> 'Shift_JIS,utf-8;q=0.7,*;q=0.7'
		'Accept-Encoding'	=> 'gzip,deflate'
		'Accept-Language'	=> 'ja,en-us;q=0.7,en;q=0.3'
		'Connection'		=> 'keep-alive'
		'Keep-Alive'		=> '300'
		'User-Agent'		=> 'AScript')
	println(resp.code, ' ', resp.version, ' ', resp.reason)
	println(resp.header)
	println('Connection    ', resp.connection)
	println('Content-Type  ', resp.content_type)
	println('Date          ', resp.date)
	println('ETag          ', resp.etag)
	println('Last-Modified ', resp.last_modified)
	println('Via           ', resp.via)
	println('Expires       ', resp.expires)
	//resp.body.readlines()::print()
	resp.body.readto('>nifty.html')
}
net.http.client('www.asahi.com') {|c|
	resp = c.get('/',
		'Accept'			=> 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
		'Accept-Charset'	=> 'Shift_JIS,utf-8;q=0.7,*;q=0.7'
		'Accept-Encoding'	=> 'gzip,deflate'
		'Accept-Language'	=> 'ja,en-us;q=0.7,en;q=0.3'
		'Connection'		=> 'keep-alive'
		'Keep-Alive'		=> '300'
		'User-Agent'		=> 'AScript')
	println(resp.code, ' ', resp.version, ' ', resp.reason)
	println(resp.header)
	println('Connection    ', resp.connection)
	println('Content-Type  ', resp.content_type)
	println('Date          ', resp.date)
	println('ETag          ', resp.etag)
	println('Last-Modified ', resp.last_modified)
	println('Via           ', resp.via)
	println('Expires       ', resp.expires)
	resp.body.readto('>asahi.html')
}
