({{, (RefLink[ConnectionSettings, paclet:ref/ConnectionSettings]) 
is an option for (RefLink[URLRead, paclet:ref/URLRead]) and related functions to specify advanced connection settings.}})

OpenersNotesSection(Spacer1)Details

(RefLink[ConnectionSettings, paclet:ref/ConnectionSettings]) takes an association with the following keys:

Maximum download and upload speed settings are approximate speed settings.

Maximum download and upload speeds can be given as (RefLink[Quantity, paclet:ref/Quantity]) expressions.

Speeds given as integers are interpreted as bytes per second.

"ProxySettings" takes an association or a list of associations with the following keys:

OpenersPrimaryExamplesSection(Spacer1)Examples  (3)

OpenersExampleSection0(Spacer1)Basic Examples  (3)

Download at 12,500 bytes per second:

URLRead["https://www.wolfram.com","BodyByteArray",ConnectionSettings-><|"MaxDownloadSpeed"->12500|>]//AbsoluteTiming

Download at 100 Kbps:

AbsoluteTiming[URLRead["https://www.wolfram.com","BodyByteArray",ConnectionSettings-><|"MaxDownloadSpeed"->Quantity[100,"Kbps"]|>]]

Download at twice the speed:

AbsoluteTiming[URLRead["https://www.wolfram.com","BodyByteArray",ConnectionSettings-><|"MaxDownloadSpeed"->Quantity[200,"Kbps"]|>]]

Create an (RefLink[APIFunction, paclet:ref/APIFunction]) returning the number of characters in a string:

api=APIFunction[{"x"->"String"},StringLength[#x]&]

Deploy the (RefLink[APIFunction, paclet:ref/APIFunction]) to the cloud:

co=CloudDeploy[api,CloudObject["string-length"],Permissions->"Public"]

Get the URL:

url=First[co]

Create a long string:

longString=StringJoin[ConstantArray["x",100000]];
StringLength[longString]

Upload the string to the API at 400 Kbps:

AbsoluteTiming[
URLRead[
HTTPRequest[url,<|Method->"POST","Body"->{"x"->longString}|>
],"Body",ConnectionSettings-><|"MaxUploadSpeed"->Quantity[400,"Kbps"]|>
]]

Upload the string to the API at 800 Kbps:

AbsoluteTiming[
URLRead[
HTTPRequest[url,<|Method->"POST","Body"->{"x"->longString}|>
],"Body",
ConnectionSettings-><|"MaxUploadSpeed"->Quantity[800,"Kbps"]|>
]]

The expected time to upload a 100,000 character string at 800 Kbps is about one second:

Quantity[ByteCount[longString],"Bytes"]/Quantity[800.,"Kbps"]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[TimeConstraint, paclet:ref/TimeConstraint])  ▪  (RefLink[Interactive, paclet:ref/Interactive])  ▪  (RefLink[Authentication, paclet:ref/Authentication])  ▪  (RefLink[PingTime, paclet:ref/PingTime])  ▪  (RefLink[URLRead, paclet:ref/URLRead])}})}})