Show / Hide Table of Contents

Class ResumableUpload<TRequest, TResponse>

Media upload which uses Google's resumable media upload protocol to upload data. The version with two types contains both a request object and a response object.

Inheritance
object
ResumableUpload
ResumableUpload<TRequest>
ResumableUpload<TRequest, TResponse>
Inherited Members
ResumableUpload<TRequest>.Service
ResumableUpload<TRequest>.Path
ResumableUpload<TRequest>.HttpMethod
ResumableUpload<TRequest>.ContentType
ResumableUpload<TRequest>.Body
ResumableUpload<TRequest>.InitiateSessionAsync(CancellationToken)
ResumableUpload.MinimumChunkSize
ResumableUpload.DefaultChunkSize
ResumableUpload.CreateFromUploadUri(Uri, Stream, ResumableUploadOptions)
ResumableUpload.Options
ResumableUpload.ContentStream
ResumableUpload.chunkSize
ResumableUpload.ChunkSize
ResumableUpload.ProgressChanged
ResumableUpload.UploadStreamInterceptor
ResumableUpload.GetProgress()
ResumableUpload.UploadSessionData
ResumableUpload.Upload()
ResumableUpload.UploadAsync()
ResumableUpload.UploadAsync(CancellationToken)
ResumableUpload.Resume()
ResumableUpload.Resume(Uri)
ResumableUpload.ResumeAsync()
ResumableUpload.ResumeAsync(CancellationToken)
ResumableUpload.ResumeAsync(Uri)
ResumableUpload.ResumeAsync(Uri, CancellationToken)
ResumableUpload.SendNextChunkAsync(Stream, CancellationToken)
ResumableUpload.ExceptionForResponseAsync(HttpResponseMessage)
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Google.Apis.Upload
Assembly: Google.Apis.dll
Syntax
public class ResumableUpload<TRequest, TResponse> : ResumableUpload<TRequest>
Type Parameters
Name Description
TRequest

The type of the body of this request. Generally this should be the metadata related to the content to be uploaded. Must be serializable to/from JSON.

TResponse

The type of the response body.

Remarks

See: https://developers.google.com/gdata/docs/resumable_upload for information on the protocol.

Constructors

ResumableUpload(IClientService, string, string, Stream, string)

Create a resumable upload instance with the required parameters.

Declaration
protected ResumableUpload(IClientService service, string path, string httpMethod, Stream contentStream, string contentType)
Parameters
Type Name Description
IClientService service

The client service.

string path

The path for this media upload method.

string httpMethod

The HTTP method to start this upload.

Stream contentStream

The stream containing the content to upload.

string contentType

Content type of the content to be uploaded.

Remarks

Considerations regarding contentStream:

  • If contentStream is seekable, then the stream position will be reset to 0 before reading commences. If contentStream is not seekable, then it will be read from its current position.
  • Caller is responsible for maintaining the contentStream open until the upload is completed.
  • Caller is responsible for closing the contentStream.

Properties

ResponseBody

The response body.

Declaration
public TResponse ResponseBody { get; }
Property Value
Type Description
TResponse
Remarks

This property will be set during upload. The ResponseReceived event is triggered when this has been set.

Methods

ProcessResponse(HttpResponseMessage)

Process the response body

Declaration
protected override void ProcessResponse(HttpResponseMessage response)
Parameters
Type Name Description
HttpResponseMessage response
Overrides
ResumableUpload.ProcessResponse(HttpResponseMessage)

Events

ResponseReceived

Event which is called when the response metadata is processed.

Declaration
public event Action<TResponse> ResponseReceived
Event Type
Type Description
Action<TResponse>
In this article
Back to top Generated by DocFX