public BeginWrite ( string dataToWrite, AsyncCallback callback, object state ) : IAsyncResult | ||
dataToWrite | string | The byte array. |
callback | AsyncCallback | The callback. |
state | object | The state. |
return | IAsyncResult |
public IAsyncResult BeginWrite(string dataToWrite, AsyncCallback callback, object state)
{
postedData = dataToWrite;
var byteArray = Encoding.UTF8.GetBytes(dataToWrite);
bytesForNextWrite = byteArray;
webRequest.ContentLength = byteArray.Length;
return webRequest.BeginGetRequestStream(callback, state);
}