HTTPS/Authenticated: Difference between revisions

(Provided ruby implementation)
Line 227:
(basicAuth "someuser" "somepassword")
print (responseBody response :: Value)</lang>
 
=={{header|Julia}}==
An example using HTTP (see the source for HTTP.jl for the code below ) to access and play a song:
<lang Julia>
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
</lang>
 
 
=={{header|Kotlin}}==
4,102

edits