September Morn Update
This commit is contained in:
parent
4e2d22a71d
commit
aac6731f2c
6856 changed files with 141342 additions and 21127 deletions
13
Task/HTTPS-Authenticated/Julia/https-authenticated.julia
Normal file
13
Task/HTTPS-Authenticated/Julia/https-authenticated.julia
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
using HTTP, HTTP.IOExtras, JSON, MusicProcessing
|
||||
HTTP.open("POST", "http://music.com/play") do io
|
||||
write(io, JSON.json([
|
||||
"auth" => "12345XXXX",
|
||||
"song_id" => 7,
|
||||
]))
|
||||
r = startread(io)
|
||||
@show r.status
|
||||
while !eof(io)
|
||||
bytes = readavailable(io)
|
||||
play(bytes)
|
||||
end
|
||||
end
|
||||
9
Task/HTTPS-Authenticated/Python/https-authenticated-2.py
Normal file
9
Task/HTTPS-Authenticated/Python/https-authenticated-2.py
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import requests
|
||||
|
||||
username = "user"
|
||||
password = "pass"
|
||||
url = "https://www.example.com"
|
||||
|
||||
response = requests.get(url, auth=(username, password)
|
||||
|
||||
print(response.text)
|
||||
9
Task/HTTPS-Authenticated/Ruby/https-authenticated.rb
Normal file
9
Task/HTTPS-Authenticated/Ruby/https-authenticated.rb
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
require 'uri'
|
||||
require 'net/http'
|
||||
|
||||
uri = URI.parse('https://www.example.com')
|
||||
response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
|
||||
request = Net::HTTP::Get.new uri
|
||||
request.basic_auth('username', 'password')
|
||||
http.request request
|
||||
end
|
||||
16
Task/HTTPS-Authenticated/Visual-Basic/https-authenticated.vb
Normal file
16
Task/HTTPS-Authenticated/Visual-Basic/https-authenticated.vb
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
Sub Main()
|
||||
Dim HttpReq As WinHttp.WinHttpRequest
|
||||
' in the "references" dialog of the IDE, check
|
||||
' "Microsoft WinHTTP Services, version 5.1" (winhttp.dll)
|
||||
Const HTTPREQUEST_PROXYSETTING_PROXY As Long = 2
|
||||
#Const USE_PROXY = 1
|
||||
Set HttpReq = New WinHttp.WinHttpRequest
|
||||
HttpReq.Open "GET", "https://www.abc.com/xyz/index.html"
|
||||
HttpReq.SetCredentials "<username>", "<password>", 0&
|
||||
#If USE_PROXY Then
|
||||
HttpReq.SetProxy HTTPREQUEST_PROXYSETTING_PROXY, "10.167.1.1:80"
|
||||
#End If
|
||||
HttpReq.SetTimeouts 1000, 1000, 1000, 1000
|
||||
HttpReq.Send
|
||||
Debug.Print HttpReq.ResponseText
|
||||
End Sub
|
||||
Loading…
Add table
Add a link
Reference in a new issue