Upraviť

Zdieľať cez


FileWebRequest.GetResponseAsync Method

Definition

Returns a response to a file system request as an asynchronous operation.

public:
 override System::Threading::Tasks::Task<System::Net::WebResponse ^> ^ GetResponseAsync();
public override System.Threading.Tasks.Task<System.Net.WebResponse> GetResponseAsync ();
override this.GetResponseAsync : unit -> System.Threading.Tasks.Task<System.Net.WebResponse>
Public Overrides Function GetResponseAsync () As Task(Of WebResponse)

Returns

The task object representing the asynchronous operation.

Exceptions

The stream is already in use by a previous call to BeginGetResponse(AsyncCallback, Object).

The FileWebRequest was aborted.

Remarks

Note

In the case of asynchronous requests, the client application is responsible for implementing its own time-out mechanism.

This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as ArgumentException, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by GetResponse().

Applies to