WebExtensions Module
A module of extension members providing asynchronous operations for some basic Web operations.
Type extensions
Type extension |
Description
|
|
Returns an asynchronous computation that, when run, will wait for the download of the given URI.
Extended Type:
Example
namespace System
namespace System.Net
namespace System.Text
val client: WebClient
type WebClient =
inherit Component
new: unit -> unit
member CancelAsync: unit -> unit
member DownloadData: address: string -> byte array + 1 overload
member DownloadDataAsync: address: Uri -> unit + 1 overload
member DownloadDataTaskAsync: address: string -> Task<byte array> + 1 overload
member DownloadFile: address: string * fileName: string -> unit + 1 overload
member DownloadFileAsync: address: Uri * fileName: string -> unit + 1 overload
member DownloadFileTaskAsync: address: string * fileName: string -> Task + 1 overload
member DownloadString: address: string -> string + 1 overload
...
<summary>Provides common methods for sending data to and receiving data from a resource identified by a URI.</summary> member WebClient.AsyncDownloadData: address: Uri -> Async<byte array>
Multiple items
type Uri = interface IFormattable interface ISpanFormattable interface IEquatable<Uri> interface ISerializable new: uriString: string -> unit + 6 overloads member Equals: comparand: obj -> bool + 1 overload member GetComponents: components: UriComponents * format: UriFormat -> string member GetHashCode: unit -> int member GetLeftPart: part: UriPartial -> string member IsBaseOf: uri: Uri -> bool ... <summary>Provides an object representation of a uniform resource identifier (URI) and easy access to the parts of the URI.</summary> -------------------- Uri(uriString: string) : Uri Uri(uriString: string, creationOptions: inref<UriCreationOptions>) : Uri Uri(uriString: string, uriKind: UriKind) : Uri Uri(baseUri: Uri, relativeUri: string) : Uri Uri(baseUri: Uri, relativeUri: Uri) : Uri Multiple items
type Async = static member AsBeginEnd: computation: ('Arg -> Async<'T>) -> ('Arg * AsyncCallback * obj -> IAsyncResult) * (IAsyncResult -> 'T) * (IAsyncResult -> unit) static member AwaitEvent: event: IEvent<'Del,'T> * ?cancelAction: (unit -> unit) -> Async<'T> (requires delegate and 'Del :> Delegate) static member AwaitIAsyncResult: iar: IAsyncResult * ?millisecondsTimeout: int -> Async<bool> static member AwaitTask: task: Task<'T> -> Async<'T> + 1 overload static member AwaitWaitHandle: waitHandle: WaitHandle * ?millisecondsTimeout: int -> Async<bool> static member CancelDefaultToken: unit -> unit static member Catch: computation: Async<'T> -> Async<Choice<'T,exn>> static member Choice: computations: Async<'T option> seq -> Async<'T option> static member FromBeginEnd: beginAction: (AsyncCallback * obj -> IAsyncResult) * endAction: (IAsyncResult -> 'T) * ?cancelAction: (unit -> unit) -> Async<'T> + 3 overloads static member FromContinuations: callback: (('T -> unit) * (exn -> unit) * (OperationCanceledException -> unit) -> unit) -> Async<'T> ... -------------------- type Async<'T> static member Async.RunSynchronously: computation: Async<'T> * ?timeout: int * ?cancellationToken: Threading.CancellationToken -> 'T
type Encoding =
interface ICloneable
member Clone: unit -> obj
member Equals: value: obj -> bool
member GetByteCount: chars: nativeptr<char> * count: int -> int + 5 overloads
member GetBytes: chars: nativeptr<char> * charCount: int * bytes: nativeptr<byte> * byteCount: int -> int + 7 overloads
member GetCharCount: bytes: nativeptr<byte> * count: int -> int + 3 overloads
member GetChars: bytes: nativeptr<byte> * byteCount: int * chars: nativeptr<char> * charCount: int -> int + 4 overloads
member GetDecoder: unit -> Decoder
member GetEncoder: unit -> Encoder
member GetHashCode: unit -> int
...
<summary>Represents a character encoding.</summary> property Encoding.ASCII: Encoding with get
<summary>Gets an encoding for the ASCII (7-bit) character set.</summary> <returns>An encoding for the ASCII (7-bit) character set.</returns> (extension) Encoding.GetString(bytes: inref<Buffers.ReadOnlySequence<byte>>) : string
Encoding.GetString(bytes: ReadOnlySpan<byte>) : string Encoding.GetString(bytes: byte array) : string Encoding.GetString(bytes: nativeptr<byte>, byteCount: int) : string Encoding.GetString(bytes: byte array, index: int, count: int) : string |
|
Returns an asynchronous computation that, when run, will wait for the download of the given URI to specified file.
Extended Type:
Example
namespace System
namespace System.Net
val client: WebClient
type WebClient =
inherit Component
new: unit -> unit
member CancelAsync: unit -> unit
member DownloadData: address: string -> byte array + 1 overload
member DownloadDataAsync: address: Uri -> unit + 1 overload
member DownloadDataTaskAsync: address: string -> Task<byte array> + 1 overload
member DownloadFile: address: string * fileName: string -> unit + 1 overload
member DownloadFileAsync: address: Uri * fileName: string -> unit + 1 overload
member DownloadFileTaskAsync: address: string * fileName: string -> Task + 1 overload
member DownloadString: address: string -> string + 1 overload
...
<summary>Provides common methods for sending data to and receiving data from a resource identified by a URI.</summary> Multiple items
type Uri = interface IFormattable interface ISpanFormattable interface IEquatable<Uri> interface ISerializable new: uriString: string -> unit + 6 overloads member Equals: comparand: obj -> bool + 1 overload member GetComponents: components: UriComponents * format: UriFormat -> string member GetHashCode: unit -> int member GetLeftPart: part: UriPartial -> string member IsBaseOf: uri: Uri -> bool ... <summary>Provides an object representation of a uniform resource identifier (URI) and easy access to the parts of the URI.</summary> -------------------- Uri(uriString: string) : Uri Uri(uriString: string, creationOptions: inref<UriCreationOptions>) : Uri Uri(uriString: string, uriKind: UriKind) : Uri Uri(baseUri: Uri, relativeUri: string) : Uri Uri(baseUri: Uri, relativeUri: Uri) : Uri val x: Uri
member WebClient.AsyncDownloadFile: address: Uri * fileName: string -> Async<unit>
Multiple items
type Async = static member AsBeginEnd: computation: ('Arg -> Async<'T>) -> ('Arg * AsyncCallback * obj -> IAsyncResult) * (IAsyncResult -> 'T) * (IAsyncResult -> unit) static member AwaitEvent: event: IEvent<'Del,'T> * ?cancelAction: (unit -> unit) -> Async<'T> (requires delegate and 'Del :> Delegate) static member AwaitIAsyncResult: iar: IAsyncResult * ?millisecondsTimeout: int -> Async<bool> static member AwaitTask: task: Task<'T> -> Async<'T> + 1 overload static member AwaitWaitHandle: waitHandle: WaitHandle * ?millisecondsTimeout: int -> Async<bool> static member CancelDefaultToken: unit -> unit static member Catch: computation: Async<'T> -> Async<Choice<'T,exn>> static member Choice: computations: Async<'T option> seq -> Async<'T option> static member FromBeginEnd: beginAction: (AsyncCallback * obj -> IAsyncResult) * endAction: (IAsyncResult -> 'T) * ?cancelAction: (unit -> unit) -> Async<'T> + 3 overloads static member FromContinuations: callback: (('T -> unit) * (exn -> unit) * (OperationCanceledException -> unit) -> unit) -> Async<'T> ... -------------------- type Async<'T> static member Async.RunSynchronously: computation: Async<'T> * ?timeout: int * ?cancellationToken: Threading.CancellationToken -> 'T
This will download the server response as a file and output it as output.html
|
|
Returns an asynchronous computation that, when run, will wait for the download of the given URI.
Extended Type:
Example
namespace System
val client: obj
Multiple items
type Uri = interface IFormattable interface ISpanFormattable interface IEquatable<Uri> interface ISerializable new: uriString: string -> unit + 6 overloads member Equals: comparand: obj -> bool + 1 overload member GetComponents: components: UriComponents * format: UriFormat -> string member GetHashCode: unit -> int member GetLeftPart: part: UriPartial -> string member IsBaseOf: uri: Uri -> bool ... <summary>Provides an object representation of a uniform resource identifier (URI) and easy access to the parts of the URI.</summary> -------------------- Uri(uriString: string) : Uri Uri(uriString: string, creationOptions: inref<UriCreationOptions>) : Uri Uri(uriString: string, uriKind: UriKind) : Uri Uri(baseUri: Uri, relativeUri: string) : Uri Uri(baseUri: Uri, relativeUri: Uri) : Uri Multiple items
type Async = static member AsBeginEnd: computation: ('Arg -> Async<'T>) -> ('Arg * AsyncCallback * obj -> IAsyncResult) * (IAsyncResult -> 'T) * (IAsyncResult -> unit) static member AwaitEvent: event: IEvent<'Del,'T> * ?cancelAction: (unit -> unit) -> Async<'T> (requires delegate and 'Del :> Delegate) static member AwaitIAsyncResult: iar: IAsyncResult * ?millisecondsTimeout: int -> Async<bool> static member AwaitTask: task: Task<'T> -> Async<'T> + 1 overload static member AwaitWaitHandle: waitHandle: WaitHandle * ?millisecondsTimeout: int -> Async<bool> static member CancelDefaultToken: unit -> unit static member Catch: computation: Async<'T> -> Async<Choice<'T,exn>> static member Choice: computations: Async<'T option> seq -> Async<'T option> static member FromBeginEnd: beginAction: (AsyncCallback * obj -> IAsyncResult) * endAction: (IAsyncResult -> 'T) * ?cancelAction: (unit -> unit) -> Async<'T> + 3 overloads static member FromContinuations: callback: (('T -> unit) * (exn -> unit) * (OperationCanceledException -> unit) -> unit) -> Async<'T> ... -------------------- type Async<'T> static member Async.RunSynchronously: computation: Async<'T> * ?timeout: int * ?cancellationToken: Threading.CancellationToken -> 'T
This will download the server response from https://www.w3.org
|
Full Usage:
this.AsyncGetResponse
Parameters:
unit
Returns: Async<WebResponse>
An asynchronous computation that waits for response to the WebRequest .
|
Returns an asynchronous computation that, when run, will wait for a response to the given WebRequest.
Extended Type:
Example
namespace System
namespace System.Net
namespace System.IO
val responseStreamToString: responseStream: WebResponse -> string
val responseStream: WebResponse
type WebResponse =
inherit MarshalByRefObject
interface IDisposable
interface ISerializable
member Close: unit -> unit
member Dispose: unit -> unit
member GetResponseStream: unit -> Stream
member ContentLength: int64
member ContentType: string
member Headers: WebHeaderCollection
member IsFromCache: bool
...
<summary>Provides a response from a Uniform Resource Identifier (URI). This is an <see langword="abstract" /> class.</summary> val reader: StreamReader
Multiple items
type StreamReader = inherit TextReader new: stream: Stream -> unit + 12 overloads member Close: unit -> unit member DiscardBufferedData: unit -> unit member Peek: unit -> int member Read: unit -> int + 2 overloads member ReadAsync: buffer: char array * index: int * count: int -> Task<int> + 1 overload member ReadBlock: buffer: char array * index: int * count: int -> int + 1 overload member ReadBlockAsync: buffer: char array * index: int * count: int -> Task<int> + 1 overload member ReadLine: unit -> string ... <summary>Implements a <see cref="T:System.IO.TextReader" /> that reads characters from a byte stream in a particular encoding.</summary> -------------------- StreamReader(stream: Stream) : StreamReader (+0 other overloads) StreamReader(path: string) : StreamReader (+0 other overloads) StreamReader(stream: Stream, detectEncodingFromByteOrderMarks: bool) : StreamReader (+0 other overloads) StreamReader(stream: Stream, encoding: System.Text.Encoding) : StreamReader (+0 other overloads) StreamReader(path: string, detectEncodingFromByteOrderMarks: bool) : StreamReader (+0 other overloads) StreamReader(path: string, options: FileStreamOptions) : StreamReader (+0 other overloads) StreamReader(path: string, encoding: System.Text.Encoding) : StreamReader (+0 other overloads) StreamReader(stream: Stream, encoding: System.Text.Encoding, detectEncodingFromByteOrderMarks: bool) : StreamReader (+0 other overloads) StreamReader(path: string, encoding: System.Text.Encoding, detectEncodingFromByteOrderMarks: bool) : StreamReader (+0 other overloads) StreamReader(stream: Stream, encoding: System.Text.Encoding, detectEncodingFromByteOrderMarks: bool, bufferSize: int) : StreamReader (+0 other overloads) WebResponse.GetResponseStream() : Stream
StreamReader.ReadToEnd() : string
val webRequest: WebRequest
type WebRequest =
inherit MarshalByRefObject
interface ISerializable
member Abort: unit -> unit
member BeginGetRequestStream: callback: AsyncCallback * state: obj -> IAsyncResult
member BeginGetResponse: callback: AsyncCallback * state: obj -> IAsyncResult
member EndGetRequestStream: asyncResult: IAsyncResult -> Stream
member EndGetResponse: asyncResult: IAsyncResult -> WebResponse
member GetRequestStream: unit -> Stream
member GetRequestStreamAsync: unit -> Task<Stream>
member GetResponse: unit -> WebResponse
...
<summary>Makes a request to a Uniform Resource Identifier (URI). This is an <see langword="abstract" /> class.</summary> val result: string
member WebRequest.AsyncGetResponse: unit -> Async<WebResponse>
Multiple items
type Async = static member AsBeginEnd: computation: ('Arg -> Async<'T>) -> ('Arg * AsyncCallback * obj -> IAsyncResult) * (IAsyncResult -> 'T) * (IAsyncResult -> unit) static member AwaitEvent: event: IEvent<'Del,'T> * ?cancelAction: (unit -> unit) -> Async<'T> (requires delegate and 'Del :> Delegate) static member AwaitIAsyncResult: iar: IAsyncResult * ?millisecondsTimeout: int -> Async<bool> static member AwaitTask: task: Task<'T> -> Async<'T> + 1 overload static member AwaitWaitHandle: waitHandle: WaitHandle * ?millisecondsTimeout: int -> Async<bool> static member CancelDefaultToken: unit -> unit static member Catch: computation: Async<'T> -> Async<Choice<'T,exn>> static member Choice: computations: Async<'T option> seq -> Async<'T option> static member FromBeginEnd: beginAction: (AsyncCallback * obj -> IAsyncResult) * endAction: (IAsyncResult -> 'T) * ?cancelAction: (unit -> unit) -> Async<'T> + 3 overloads static member FromContinuations: callback: (('T -> unit) * (exn -> unit) * (OperationCanceledException -> unit) -> unit) -> Async<'T> ... -------------------- type Async<'T> static member Async.RunSynchronously: computation: Async<'T> * ?timeout: int * ?cancellationToken: System.Threading.CancellationToken -> 'T
|