ProtoBufServiceClient
Assembly: ServiceStack.ProtoBuf.dll
View Source
public class ProtoBufServiceClient : ServiceClientBase, IServiceClient, IRestServiceClient, IServiceClientAsync, IServiceGatewayAsync, IServiceClientSync, IHasSessionId, IHasBearerToken, IHasVersion, IHttpRestClientAsync, IRestClientAsync, IReplyClient, IServiceGateway, IOneWayClient, IRestClient, IRestClientSync, IServiceClientCommon, IMessageProducer, IDisposable, IHasCookieContainer, IServiceClientMeta
Properties
Format
View Source
public override string Format { get; }
ContentType
View Source
public override string ContentType { get; }
StreamDeserializer
View Source
public override StreamDeserializerDelegate StreamDeserializer { get; }
Inherited Properties
Accept
View Source
public virtual string Accept { get; }
AllowAutoRedirect
View Source
public bool AllowAutoRedirect { get; set; }
AlwaysSendBasicAuthHeader
Determines if the basic auth header should be sent with every request. By default, the basic auth header is only sent when "401 Unauthorized" is returned.
View Source
public bool AlwaysSendBasicAuthHeader { get; set; }
AsyncOneWayBaseUri
View Source
public string AsyncOneWayBaseUri { get; set; }
BasePath
Relative BasePath to use for predefined routes. Set with UseBasePath
or WithBasePath()
Always contains '/' prefix + '/' suffix, e.g. /api/
View Source
public string BasePath { get; protected set; }
BaseUri
View Source
public string BaseUri { get; set; }
BearerToken
The Authorization Bearer Token to send with this request
View Source
public string BearerToken { get; set; }
ContentType
View Source
public abstract string ContentType { get; }
CookieContainer
View Source
public CookieContainer CookieContainer { get; set; }
Credentials
Gets or sets authentication information for the request. Warning: It's recommend to use ServiceStack.ServiceClientBase.UserName and ServiceStack.ServiceClientBase.Password for basic auth. This property is only used for IIS level authentication.
View Source
public ICredentials Credentials { get; set; }
DisableAutoCompression
Whether to Accept Gzip,Deflate Content-Encoding and to auto decompress responses
View Source
public bool DisableAutoCompression { get; set; }
EmulateHttpViaPost
View Source
public bool EmulateHttpViaPost { get; set; }
EnableAutoRefreshToken
Whether to enable auto refreshing token of JWT Tokens from Refresh Tokens
View Source
public bool EnableAutoRefreshToken { get; set; }
ExceptionFilter
Called with requestUri, ResponseType when server returns 304 NotModified
View Source
public ExceptionFilterDelegate ExceptionFilter { get; set; }
Format
View Source
public abstract string Format { get; }
GlobalRequestFilter
The request filter is called before any request. This request filter is executed globally.
View Source
public static Action<HttpWebRequest> GlobalRequestFilter { get; set; }
GlobalResponseFilter
The response action is called once the server response is available. It will allow you to access raw response information. This response action is executed globally. Note that you should NOT consume the response stream as this is handled by ServiceStack
View Source
public static Action<HttpWebResponse> GlobalResponseFilter { get; set; }
Headers
Gets the collection of headers to be added to outgoing requests.
View Source
public NameValueCollection Headers { get; }
HttpLog
View Source
public StringBuilder HttpLog { get; set; }
HttpLogFilter
View Source
public Action<StringBuilder> HttpLogFilter { get; set; }
HttpMethod
View Source
public string HttpMethod { get; set; }
OnAuthenticationRequired
Called before request resend, when the initial request required authentication
View Source
public Action OnAuthenticationRequired { get; set; }
OnDownloadProgress
View Source
public ProgressDelegate OnDownloadProgress { get; set; }
OnUploadProgress
View Source
public ProgressDelegate OnUploadProgress { get; set; }
Password
The password for basic authentication
View Source
public string Password { get; set; }
Proxy
View Source
public IWebProxy Proxy { get; set; }
ReadWriteTimeout
View Source
public TimeSpan? ReadWriteTimeout { get; set; }
RefreshToken
If a request fails with a 401 Unauthorized and a BearerToken is present the client will automatically fetch a new AccessToken using this RefreshToken and retry the request
View Source
public string RefreshToken { get; set; }
RefreshTokenUri
Send the Request to get the AccessToken with the RefreshToken at a non-default location
View Source
public string RefreshTokenUri { get; set; }
RequestCompressionType
View Source
public string RequestCompressionType { get; set; }
RequestFilter
The request filter is called before any request. This request filter only works with the instance where it was set (not global).
View Source
public Action<HttpWebRequest> RequestFilter { get; set; }
ResponseFilter
The response action is called once the server response is available. It will allow you to access raw response information. Note that you should NOT consume the response stream as this is handled by ServiceStack
View Source
public Action<HttpWebResponse> ResponseFilter { get; set; }
ResultsFilter
The ResultsFilter is called before the Request is sent allowing you to return a cached response.
View Source
public ResultsFilterDelegate ResultsFilter { get; set; }
ResultsFilterResponse
The ResultsFilterResponse is called before returning the response allowing responses to be cached.
View Source
public ResultsFilterResponseDelegate ResultsFilterResponse { get; set; }
SessionId
View Source
public string SessionId { get; set; }
ShareCookiesWithBrowser
View Source
public bool ShareCookiesWithBrowser { get; set; }
StoreCookies
Specifies if cookies should be stored
View Source
public bool StoreCookies { get; set; }
StreamDeserializer
View Source
public abstract StreamDeserializerDelegate StreamDeserializer { get; }
SyncReplyBaseUri
View Source
public string SyncReplyBaseUri { get; set; }
Timeout
View Source
public TimeSpan? Timeout { get; set; }
TypedUrlResolver
View Source
public TypedUrlResolverDelegate TypedUrlResolver { get; set; }
UrlResolver
View Source
public UrlResolverDelegate UrlResolver { get; set; }
UseBasePath
Replace the Base reply/oneway paths to use a different prefix
View Source
public string UseBasePath { set; }
UserAgent
View Source
public string UserAgent { get; set; }
UserName
The user name for basic authentication
View Source
public string UserName { get; set; }
Version
View Source
public int Version { get; set; }
Methods
SerializeToStream(IRequest, Object, Stream)
View Source
public override void SerializeToStream(IRequest req, object request, Stream stream)
Parameters
Type | Name |
---|---|
ServiceStack.Web.IRequest | req |
System.Object | request |
System.IO.Stream | stream |
DeserializeFromStream<T>(Stream)
View Source
public override T DeserializeFromStream<T>(Stream stream)
Returns
<T>
Parameters
Type | Name |
---|---|
System.IO.Stream | stream |
Type Parameters
T
Inherited Methods
AddHeader(String, String)
View Source
public void AddHeader(string name, string value)
Parameters
Type | Name |
---|---|
System.String | name |
System.String | value |
CaptureHttp(Action<StringBuilder>)
View Source
public void CaptureHttp(Action<StringBuilder> httpFilter)
Parameters
Type | Name |
---|---|
System.Action<System.Text.StringBuilder> | httpFilter |
CaptureHttp(Boolean, Boolean, Boolean)
View Source
public void CaptureHttp(bool print = false, bool log = false, bool clear = true)
Parameters
Type | Name |
---|---|
System.Boolean | |
System.Boolean | log |
System.Boolean | clear |
ClearCookies()
View Source
public void ClearCookies()
CustomMethod(String, IReturnVoid)
View Source
public virtual void CustomMethod(string httpVerb, IReturnVoid requestDto)
Parameters
Type | Name |
---|---|
System.String | httpVerb |
ServiceStack.IReturnVoid | requestDto |
CustomMethod(String, Object)
APIs returning HttpWebResponse must be explicitly Disposed, e.g using (var res = client.CustomMethod(method,dto)) { ... }
View Source
public virtual HttpWebResponse CustomMethod(string httpVerb, object requestDto)
Returns
System.Net.HttpWebResponse
Parameters
Type | Name |
---|---|
System.String | httpVerb |
System.Object | requestDto |
CustomMethod(String, String, Object)
APIs returning HttpWebResponse must be explicitly Disposed, e.g using (var res = client.CustomMethod(method,dto)) { ... }
View Source
public virtual HttpWebResponse CustomMethod(string httpVerb, string relativeOrAbsoluteUrl, object requestDto)
Returns
System.Net.HttpWebResponse
Parameters
Type | Name |
---|---|
System.String | httpVerb |
System.String | relativeOrAbsoluteUrl |
System.Object | requestDto |
CustomMethod<TResponse>(String, IReturn<TResponse>)
View Source
public virtual TResponse CustomMethod<TResponse>(string httpVerb, IReturn<TResponse> requestDto)
Returns
<TResponse>
Parameters
Type | Name |
---|---|
System.String | httpVerb |
ServiceStack.IReturn<T> | requestDto |
Type Parameters
TResponse
CustomMethod<TResponse>(String, Object)
View Source
public virtual TResponse CustomMethod<TResponse>(string httpVerb, object requestDto)
Returns
<TResponse>
Parameters
Type | Name |
---|---|
System.String | httpVerb |
System.Object | requestDto |
Type Parameters
TResponse
CustomMethod<TResponse>(String, String, Object)
View Source
public virtual TResponse CustomMethod<TResponse>(string httpVerb, string relativeOrAbsoluteUrl, object requestDto = null)
Returns
<TResponse>
Parameters
Type | Name |
---|---|
System.String | httpVerb |
System.String | relativeOrAbsoluteUrl |
System.Object | requestDto |
Type Parameters
TResponse
CustomMethodAsync(String, IReturnVoid, CancellationToken)
View Source
public virtual Task CustomMethodAsync(string httpVerb, IReturnVoid requestDto, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
System.String | httpVerb |
ServiceStack.IReturnVoid | requestDto |
System.Threading.CancellationToken | token |
CustomMethodAsync<TResponse>(String, IReturn<TResponse>, CancellationToken)
View Source
public virtual Task<TResponse> CustomMethodAsync<TResponse>(string httpVerb, IReturn<TResponse> requestDto, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type | Name |
---|---|
System.String | httpVerb |
ServiceStack.IReturn<T> | requestDto |
System.Threading.CancellationToken | token |
Type Parameters
TResponse
CustomMethodAsync<TResponse>(String, Object, CancellationToken)
View Source
public virtual Task<TResponse> CustomMethodAsync<TResponse>(string httpVerb, object requestDto, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type | Name |
---|---|
System.String | httpVerb |
System.Object | requestDto |
System.Threading.CancellationToken | token |
Type Parameters
TResponse
CustomMethodAsync<TResponse>(String, String, Object, CancellationToken)
View Source
public virtual Task<TResponse> CustomMethodAsync<TResponse>(string httpVerb, string relativeOrAbsoluteUrl, object request, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type | Name |
---|---|
System.String | httpVerb |
System.String | relativeOrAbsoluteUrl |
System.Object | request |
System.Threading.CancellationToken | token |
Type Parameters
TResponse
Delete(IReturnVoid)
View Source
public virtual void Delete(IReturnVoid requestDto)
Parameters
Type | Name |
---|---|
ServiceStack.IReturnVoid | requestDto |
Delete(Object)
APIs returning HttpWebResponse must be explicitly Disposed, e.g using (var res = client.Delete(url)) { ... }
View Source
[Obsolete("Use: using (client.Delete<HttpWebResponse>(requestDto) { }")]
public virtual HttpWebResponse Delete(object requestDto)
Returns
System.Net.HttpWebResponse
Parameters
Type | Name |
---|---|
System.Object | requestDto |
Delete(String)
APIs returning HttpWebResponse must be explicitly Disposed, e.g using (var res = client.Delete(url)) { ... }
View Source
[Obsolete("Use: using (client.Delete<HttpWebResponse>(relativeOrAbsoluteUrl) { }")]
public virtual HttpWebResponse Delete(string relativeOrAbsoluteUrl)
Returns
System.Net.HttpWebResponse
Parameters
Type | Name |
---|---|
System.String | relativeOrAbsoluteUrl |
Delete<TResponse>(IReturn<TResponse>)
View Source
public virtual TResponse Delete<TResponse>(IReturn<TResponse> requestDto)
Returns
<TResponse>
Parameters
Type | Name |
---|---|
ServiceStack.IReturn<T> | requestDto |
Type Parameters
TResponse
Delete<TResponse>(Object)
View Source
public virtual TResponse Delete<TResponse>(object requestDto)
Returns
<TResponse>
Parameters
Type | Name |
---|---|
System.Object | requestDto |
Type Parameters
TResponse
Delete<TResponse>(String)
View Source
public virtual TResponse Delete<TResponse>(string relativeOrAbsoluteUrl)
Returns
<TResponse>
Parameters
Type | Name |
---|---|
System.String | relativeOrAbsoluteUrl |
Type Parameters
TResponse
DeleteAsync(IReturnVoid, CancellationToken)
View Source
public virtual Task DeleteAsync(IReturnVoid requestDto, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.IReturnVoid | requestDto |
System.Threading.CancellationToken | token |
DeleteAsync<TResponse>(IReturn<TResponse>, CancellationToken)
View Source
public virtual Task<TResponse> DeleteAsync<TResponse>(IReturn<TResponse> requestDto, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type | Name |
---|---|
ServiceStack.IReturn<T> | requestDto |
System.Threading.CancellationToken | token |
Type Parameters
TResponse
DeleteAsync<TResponse>(Object, CancellationToken)
View Source
public virtual Task<TResponse> DeleteAsync<TResponse>(object requestDto, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type | Name |
---|---|
System.Object | requestDto |
System.Threading.CancellationToken | token |
Type Parameters
TResponse
DeleteAsync<TResponse>(String, CancellationToken)
View Source
public virtual Task<TResponse> DeleteAsync<TResponse>(string relativeOrAbsoluteUrl, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type | Name |
---|---|
System.String | relativeOrAbsoluteUrl |
System.Threading.CancellationToken | token |
Type Parameters
TResponse
Deserialize<T>(String)
View Source
protected T Deserialize<T>(string text)
Returns
<T>
Parameters
Type | Name |
---|---|
System.String | text |
Type Parameters
T
DeserializeFromStream<T>(Stream)
View Source
public abstract T DeserializeFromStream<T>(Stream stream)
Returns
<T>
Parameters
Type | Name |
---|---|
System.IO.Stream | stream |
Type Parameters
T
Dispose()
View Source
public void Dispose()
DownloadBytes(String, String, Object)
View Source
public byte[] DownloadBytes(string httpMethod, string requestUri, object request)
Returns
System.Byte[]
Parameters
Type | Name |
---|---|
System.String | httpMethod |
System.String | requestUri |
System.Object | request |
DownloadBytesAsync(String, String, Object)
View Source
public async Task<byte[]> DownloadBytesAsync(string httpMethod, string requestUri, object request)
Returns
System.Threading.Tasks.Task<System.Byte[]>
Parameters
Type | Name |
---|---|
System.String | httpMethod |
System.String | requestUri |
System.Object | request |
Get(IReturnVoid)
View Source
public virtual void Get(IReturnVoid requestDto)
Parameters
Type | Name |
---|---|
ServiceStack.IReturnVoid | requestDto |
Get(Object)
APIs returning HttpWebResponse must be explicitly Disposed, e.g using (var res = client.Get(url)) { ... }
View Source
[Obsolete("Use: using var res = client.Get<HttpWebResponse>(requestDto)")]
public virtual HttpWebResponse Get(object requestDto)
Returns
System.Net.HttpWebResponse
Parameters
Type | Name |
---|---|
System.Object | requestDto |
Get(String)
APIs returning HttpWebResponse must be explicitly Disposed, e.g using (var res = client.Get(url)) { ... }
View Source
[Obsolete("Use: using var res = client.Get<HttpWebResponse>(relativeOrAbsoluteUrl)")]
public virtual HttpWebResponse Get(string relativeOrAbsoluteUrl)
Returns
System.Net.HttpWebResponse
Parameters
Type | Name |
---|---|
System.String | relativeOrAbsoluteUrl |
Get<TResponse>(IReturn<TResponse>)
View Source
public virtual TResponse Get<TResponse>(IReturn<TResponse> requestDto)
Returns
<TResponse>
Parameters
Type | Name |
---|---|
ServiceStack.IReturn<T> | requestDto |
Type Parameters
TResponse
Get<TResponse>(Object)
View Source
public virtual TResponse Get<TResponse>(object requestDto)
Returns
<TResponse>
Parameters
Type | Name |
---|---|
System.Object | requestDto |
Type Parameters
TResponse
Get<TResponse>(String)
View Source
public virtual TResponse Get<TResponse>(string relativeOrAbsoluteUrl)
Returns
<TResponse>
Parameters
Type | Name |
---|---|
System.String | relativeOrAbsoluteUrl |
Type Parameters
TResponse
GetAsync(IReturnVoid, CancellationToken)
View Source
public virtual Task GetAsync(IReturnVoid requestDto, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.IReturnVoid | requestDto |
System.Threading.CancellationToken | token |
GetAsync<TResponse>(IReturn<TResponse>, CancellationToken)
View Source
public virtual Task<TResponse> GetAsync<TResponse>(IReturn<TResponse> requestDto, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type | Name |
---|---|
ServiceStack.IReturn<T> | requestDto |
System.Threading.CancellationToken | token |
Type Parameters
TResponse
GetAsync<TResponse>(Object, CancellationToken)
View Source
public virtual Task<TResponse> GetAsync<TResponse>(object requestDto, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type | Name |
---|---|
System.Object | requestDto |
System.Threading.CancellationToken | token |
Type Parameters
TResponse
GetAsync<TResponse>(String, CancellationToken)
View Source
public virtual Task<TResponse> GetAsync<TResponse>(string relativeOrAbsoluteUrl, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type | Name |
---|---|
System.String | relativeOrAbsoluteUrl |
System.Threading.CancellationToken | token |
Type Parameters
TResponse
GetCookieValues()
View Source
public Dictionary<string, string> GetCookieValues()
Returns
System.Collections.Generic.Dictionary<System.String,System.String>
GetHttpMethod(Object)
View Source
public string GetHttpMethod(object request)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Object | request |
GetLazy<TResponse>(IReturn<QueryResponse<TResponse>>)
View Source
public virtual IEnumerable<TResponse> GetLazy<TResponse>(IReturn<QueryResponse<TResponse>> queryDto)
Returns
System.Collections.Generic.IEnumerable<<TResponse>>
Parameters
Type | Name |
---|---|
ServiceStack.IReturn<T> | queryDto |
Type Parameters
TResponse
GetResponse<TResponse>(WebResponse)
View Source
protected TResponse GetResponse<TResponse>(WebResponse webRes)
Returns
<TResponse>
Parameters
Type | Name |
---|---|
System.Net.WebResponse | webRes |
Type Parameters
TResponse
HandleResponseException<TResponse>(Exception, Object, String, Func<WebRequest>, Func<WebRequest, WebResponse>, out TResponse)
Called by Send method if an exception occurs, for instance a System.Net.WebException because the server
returned an HTTP error code. Override if you want to handle specific exceptions or always want to parse the
response to a custom ErrorResponse DTO type instead of ServiceStack's ErrorResponse class. In case ex is a
System.Net.WebException
, do not use
createWebRequest
/getResponse
/HandleResponse<TResponse>
to parse the response
because that will result in the same exception again. Use
ThrowWebServiceException<YourErrorResponseType>
to parse the response and to throw a
WebServiceException
containing the parsed DTO. Then override Send to handle that exception.
View Source
protected virtual bool HandleResponseException<TResponse>(Exception ex, object request, string requestUri, Func<WebRequest> createWebRequest, Func<WebRequest, WebResponse> getResponse, out TResponse response)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Exception | ex |
System.Object | request |
System.String | requestUri |
System.Func<System.Net.WebRequest> | createWebRequest |
System.Func<System.Net.WebRequest,System.Net.WebResponse> | getResponse |
<TResponse> | response |
Type Parameters
TResponse
Head(IReturn)
APIs returning HttpWebResponse must be explicitly Disposed, e.g using (var res = client.Head(request)) { ... }
View Source
public virtual HttpWebResponse Head(IReturn requestDto)
Returns
System.Net.HttpWebResponse
Parameters
Type | Name |
---|---|
ServiceStack.IReturn | requestDto |
Head(Object)
APIs returning HttpWebResponse must be explicitly Disposed, e.g using (var res = client.Head(request)) { ... }
View Source
public virtual HttpWebResponse Head(object requestDto)
Returns
System.Net.HttpWebResponse
Parameters
Type | Name |
---|---|
System.Object | requestDto |
Head(String)
APIs returning HttpWebResponse must be explicitly Disposed, e.g using (var res = client.Head(request)) { ... }
View Source
public virtual HttpWebResponse Head(string relativeOrAbsoluteUrl)
Returns
System.Net.HttpWebResponse
Parameters
Type | Name |
---|---|
System.String | relativeOrAbsoluteUrl |
Patch(IReturnVoid)
View Source
public virtual void Patch(IReturnVoid requestDto)
Parameters
Type | Name |
---|---|
ServiceStack.IReturnVoid | requestDto |
Patch(Object)
View Source
[Obsolete("Use: using (client.Patch<HttpWebResponse>(requestDto) { }")]
public virtual HttpWebResponse Patch(object requestDto)
Returns
System.Net.HttpWebResponse
Parameters
Type | Name |
---|---|
System.Object | requestDto |
Patch<TResponse>(IReturn<TResponse>)
View Source
public virtual TResponse Patch<TResponse>(IReturn<TResponse> requestDto)
Returns
<TResponse>
Parameters
Type | Name |
---|---|
ServiceStack.IReturn<T> | requestDto |
Type Parameters
TResponse
Patch<TResponse>(Object)
View Source
public virtual TResponse Patch<TResponse>(object requestDto)
Returns
<TResponse>
Parameters
Type | Name |
---|---|
System.Object | requestDto |
Type Parameters
TResponse
Patch<TResponse>(String, Object)
View Source
public virtual TResponse Patch<TResponse>(string relativeOrAbsoluteUrl, object requestDto)
Returns
<TResponse>
Parameters
Type | Name |
---|---|
System.String | relativeOrAbsoluteUrl |
System.Object | requestDto |
Type Parameters
TResponse
PatchAsync(IReturnVoid, CancellationToken)
View Source
public virtual Task PatchAsync(IReturnVoid requestDto, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.IReturnVoid | requestDto |
System.Threading.CancellationToken | token |
PatchAsync<TResponse>(IReturn<TResponse>, CancellationToken)
View Source
public virtual Task<TResponse> PatchAsync<TResponse>(IReturn<TResponse> requestDto, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type | Name |
---|---|
ServiceStack.IReturn<T> | requestDto |
System.Threading.CancellationToken | token |
Type Parameters
TResponse
PatchAsync<TResponse>(Object, CancellationToken)
View Source
public virtual Task<TResponse> PatchAsync<TResponse>(object requestDto, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type | Name |
---|---|
System.Object | requestDto |
System.Threading.CancellationToken | token |
Type Parameters
TResponse
PatchAsync<TResponse>(String, Object, CancellationToken)
View Source
public virtual Task<TResponse> PatchAsync<TResponse>(string relativeOrAbsoluteUrl, object request, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type | Name |
---|---|
System.String | relativeOrAbsoluteUrl |
System.Object | request |
System.Threading.CancellationToken | token |
Type Parameters
TResponse
Post(IReturnVoid)
View Source
public virtual void Post(IReturnVoid requestDto)
Parameters
Type | Name |
---|---|
ServiceStack.IReturnVoid | requestDto |
Post(Object)
APIs returning HttpWebResponse must be explicitly Disposed, e.g using (var res = client.Post(url)) { ... }
View Source
[Obsolete("Use: using (client.Post<HttpWebResponse>(requestDto) { }")]
public virtual HttpWebResponse Post(object requestDto)
Returns
System.Net.HttpWebResponse
Parameters
Type | Name |
---|---|
System.Object | requestDto |
Post<TResponse>(IReturn<TResponse>)
View Source
public virtual TResponse Post<TResponse>(IReturn<TResponse> requestDto)
Returns
<TResponse>
Parameters
Type | Name |
---|---|
ServiceStack.IReturn<T> | requestDto |
Type Parameters
TResponse
Post<TResponse>(Object)
View Source
public virtual TResponse Post<TResponse>(object requestDto)
Returns
<TResponse>
Parameters
Type | Name |
---|---|
System.Object | requestDto |
Type Parameters
TResponse
Post<TResponse>(String, Object)
View Source
public virtual TResponse Post<TResponse>(string relativeOrAbsoluteUrl, object requestDto)
Returns
<TResponse>
Parameters
Type | Name |
---|---|
System.String | relativeOrAbsoluteUrl |
System.Object | requestDto |
Type Parameters
TResponse
PostAsync(IReturnVoid, CancellationToken)
View Source
public virtual Task PostAsync(IReturnVoid requestDto, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.IReturnVoid | requestDto |
System.Threading.CancellationToken | token |
PostAsync<TResponse>(IReturn<TResponse>, CancellationToken)
View Source
public virtual Task<TResponse> PostAsync<TResponse>(IReturn<TResponse> requestDto, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type | Name |
---|---|
ServiceStack.IReturn<T> | requestDto |
System.Threading.CancellationToken | token |
Type Parameters
TResponse
PostAsync<TResponse>(Object, CancellationToken)
View Source
public virtual Task<TResponse> PostAsync<TResponse>(object requestDto, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type | Name |
---|---|
System.Object | requestDto |
System.Threading.CancellationToken | token |
Type Parameters
TResponse
PostAsync<TResponse>(String, Object, CancellationToken)
View Source
public virtual Task<TResponse> PostAsync<TResponse>(string relativeOrAbsoluteUrl, object request, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type | Name |
---|---|
System.String | relativeOrAbsoluteUrl |
System.Object | request |
System.Threading.CancellationToken | token |
Type Parameters
TResponse
PostFile<TResponse>(String, Stream, String, String, String)
View Source
public virtual TResponse PostFile<TResponse>(string relativeOrAbsoluteUrl, Stream fileToUpload, string fileName, string mimeType, string fieldName = "file")
Returns
<TResponse>
Parameters
Type | Name |
---|---|
System.String | relativeOrAbsoluteUrl |
System.IO.Stream | fileToUpload |
System.String | fileName |
System.String | mimeType |
System.String | fieldName |
Type Parameters
TResponse
PostFilesWithRequest<TResponse>(Object, IEnumerable<UploadFile>)
View Source
public virtual TResponse PostFilesWithRequest<TResponse>(object request, IEnumerable<UploadFile> files)
Returns
<TResponse>
Parameters
Type | Name |
---|---|
System.Object | request |
System.Collections.Generic.IEnumerable<ServiceStack.UploadFile> | files |
Type Parameters
TResponse
PostFilesWithRequest<TResponse>(String, Object, IEnumerable<UploadFile>)
View Source
public virtual TResponse PostFilesWithRequest<TResponse>(string relativeOrAbsoluteUrl, object request, IEnumerable<UploadFile> files)
Returns
<TResponse>
Parameters
Type | Name |
---|---|
System.String | relativeOrAbsoluteUrl |
System.Object | request |
System.Collections.Generic.IEnumerable<ServiceStack.UploadFile> | files |
Type Parameters
TResponse
PostFileWithRequest<TResponse>(Stream, String, Object, String)
View Source
public virtual TResponse PostFileWithRequest<TResponse>(Stream fileToUpload, string fileName, object request, string fieldName = "file")
Returns
<TResponse>
Parameters
Type | Name |
---|---|
System.IO.Stream | fileToUpload |
System.String | fileName |
System.Object | request |
System.String | fieldName |
Type Parameters
TResponse
PostFileWithRequest<TResponse>(String, Stream, String, Object, String)
View Source
public virtual TResponse PostFileWithRequest<TResponse>(string relativeOrAbsoluteUrl, Stream fileToUpload, string fileName, object request, string fieldName = "file")
Returns
<TResponse>
Parameters
Type | Name |
---|---|
System.String | relativeOrAbsoluteUrl |
System.IO.Stream | fileToUpload |
System.String | fileName |
System.Object | request |
System.String | fieldName |
Type Parameters
TResponse
PrepareWebRequest(String, String, Object, Action<HttpWebRequest>)
View Source
protected WebRequest PrepareWebRequest(string httpMethod, string requestUri, object request, Action<HttpWebRequest> sendRequestAction)
Returns
System.Net.WebRequest
Parameters
Type | Name |
---|---|
System.String | httpMethod |
System.String | requestUri |
System.Object | request |
System.Action<System.Net.HttpWebRequest> | sendRequestAction |
Publish(Object)
View Source
public virtual void Publish(object requestDto)
Parameters
Type | Name |
---|---|
System.Object | requestDto |
Publish<T>(T)
View Source
public void Publish<T>(T requestDto)
Parameters
Type | Name |
---|---|
<T> | requestDto |
Type Parameters
T
Publish<T>(IMessage<T>)
View Source
public void Publish<T>(IMessage<T> message)
Parameters
Type | Name |
---|---|
ServiceStack.Messaging.IMessage<T> | message |
Type Parameters
T
PublishAll(IEnumerable<Object>)
View Source
public void PublishAll(IEnumerable<object> requests)
Parameters
Type | Name |
---|---|
System.Collections.Generic.IEnumerable<System.Object> | requests |
PublishAllAsync(IEnumerable<Object>, CancellationToken)
View Source
public Task PublishAllAsync(IEnumerable<object> requests, CancellationToken token)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
System.Collections.Generic.IEnumerable<System.Object> | requests |
System.Threading.CancellationToken | token |
PublishAsync(Object, CancellationToken)
View Source
public Task PublishAsync(object request, CancellationToken token)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
System.Object | request |
System.Threading.CancellationToken | token |
Put(IReturnVoid)
View Source
public virtual void Put(IReturnVoid requestDto)
Parameters
Type | Name |
---|---|
ServiceStack.IReturnVoid | requestDto |
Put(Object)
APIs returning HttpWebResponse must be explicitly Disposed, e.g using (var res = client.Put(url)) { ... }
View Source
[Obsolete("Use: using (client.Put<HttpWebResponse>(requestDto) { }")]
public virtual HttpWebResponse Put(object requestDto)
Returns
System.Net.HttpWebResponse
Parameters
Type | Name |
---|---|
System.Object | requestDto |
Put<TResponse>(IReturn<TResponse>)
View Source
public virtual TResponse Put<TResponse>(IReturn<TResponse> requestDto)
Returns
<TResponse>
Parameters
Type | Name |
---|---|
ServiceStack.IReturn<T> | requestDto |
Type Parameters
TResponse
Put<TResponse>(Object)
View Source
public virtual TResponse Put<TResponse>(object requestDto)
Returns
<TResponse>
Parameters
Type | Name |
---|---|
System.Object | requestDto |
Type Parameters
TResponse
Put<TResponse>(String, Object)
View Source
public virtual TResponse Put<TResponse>(string relativeOrAbsoluteUrl, object requestDto)
Returns
<TResponse>
Parameters
Type | Name |
---|---|
System.String | relativeOrAbsoluteUrl |
System.Object | requestDto |
Type Parameters
TResponse
PutAsync(IReturnVoid, CancellationToken)
View Source
public virtual Task PutAsync(IReturnVoid requestDto, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.IReturnVoid | requestDto |
System.Threading.CancellationToken | token |
PutAsync<TResponse>(IReturn<TResponse>, CancellationToken)
View Source
public virtual Task<TResponse> PutAsync<TResponse>(IReturn<TResponse> requestDto, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type | Name |
---|---|
ServiceStack.IReturn<T> | requestDto |
System.Threading.CancellationToken | token |
Type Parameters
TResponse
PutAsync<TResponse>(Object, CancellationToken)
View Source
public virtual Task<TResponse> PutAsync<TResponse>(object requestDto, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type | Name |
---|---|
System.Object | requestDto |
System.Threading.CancellationToken | token |
Type Parameters
TResponse
PutAsync<TResponse>(String, Object, CancellationToken)
View Source
public virtual Task<TResponse> PutAsync<TResponse>(string relativeOrAbsoluteUrl, object request, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type | Name |
---|---|
System.String | relativeOrAbsoluteUrl |
System.Object | request |
System.Threading.CancellationToken | token |
Type Parameters
TResponse
ResolveTypedUrl(String, Object)
View Source
public virtual string ResolveTypedUrl(string httpMethod, object requestDto)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | httpMethod |
System.Object | requestDto |
ResolveUrl(String, String)
View Source
public virtual string ResolveUrl(string httpMethod, string relativeOrAbsoluteUrl)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | httpMethod |
System.String | relativeOrAbsoluteUrl |
Send<TResponse>(Object)
View Source
public virtual TResponse Send<TResponse>(object request)
Returns
<TResponse>
Parameters
Type | Name |
---|---|
System.Object | request |
Type Parameters
TResponse
Send<TResponse>(String, String, Object)
View Source
public virtual TResponse Send<TResponse>(string httpMethod, string relativeOrAbsoluteUrl, object request)
Returns
<TResponse>
Parameters
Type | Name |
---|---|
System.String | httpMethod |
System.String | relativeOrAbsoluteUrl |
System.Object | request |
Type Parameters
TResponse
SendAll<TResponse>(IEnumerable<Object>)
View Source
public virtual List<TResponse> SendAll<TResponse>(IEnumerable<object> requests)
Returns
System.Collections.Generic.List<<TResponse>>
Parameters
Type | Name |
---|---|
System.Collections.Generic.IEnumerable<System.Object> | requests |
Type Parameters
TResponse
SendAllAsync<TResponse>(IEnumerable<Object>, CancellationToken)
View Source
public Task<List<TResponse>> SendAllAsync<TResponse>(IEnumerable<object> requests, CancellationToken token)
Returns
System.Threading.Tasks.Task<System.Collections.Generic.List<<TResponse>>>
Parameters
Type | Name |
---|---|
System.Collections.Generic.IEnumerable<System.Object> | requests |
System.Threading.CancellationToken | token |
Type Parameters
TResponse
SendAllOneWay(IEnumerable<Object>)
View Source
public virtual void SendAllOneWay(IEnumerable<object> requests)
Parameters
Type | Name |
---|---|
System.Collections.Generic.IEnumerable<System.Object> | requests |
SendAsync<TResponse>(Object, CancellationToken)
View Source
public virtual async Task<TResponse> SendAsync<TResponse>(object request, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type | Name |
---|---|
System.Object | request |
System.Threading.CancellationToken | token |
Type Parameters
TResponse
SendAsync<TResponse>(String, String, Object, CancellationToken)
View Source
public Task<TResponse> SendAsync<TResponse>(string httpMethod, string absoluteUrl, object request, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type | Name |
---|---|
System.String | httpMethod |
System.String | absoluteUrl |
System.Object | request |
System.Threading.CancellationToken | token |
Type Parameters
TResponse
SendOneWay(Object)
View Source
public virtual void SendOneWay(object request)
Parameters
Type | Name |
---|---|
System.Object | request |
SendOneWay(String, Object)
View Source
public virtual void SendOneWay(string relativeOrAbsoluteUrl, object request)
Parameters
Type | Name |
---|---|
System.String | relativeOrAbsoluteUrl |
System.Object | request |
SendOneWay(String, String, Object)
View Source
public virtual void SendOneWay(string httpMethod, string relativeOrAbsoluteUrl, object requestDto)
Parameters
Type | Name |
---|---|
System.String | httpMethod |
System.String | relativeOrAbsoluteUrl |
System.Object | requestDto |
SendRequest(String, String, Object)
View Source
protected virtual WebRequest SendRequest(string httpMethod, string requestUri, object request)
Returns
System.Net.WebRequest
Parameters
Type | Name |
---|---|
System.String | httpMethod |
System.String | requestUri |
System.Object | request |
SendStringToUrl(HttpWebRequest, String, String, String, String, Action<HttpWebRequest>, Action<HttpWebResponse>)
View Source
public static string SendStringToUrl(HttpWebRequest webReq, string method, string requestBody, string contentType, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Net.HttpWebRequest | webReq |
System.String | method |
System.String | requestBody |
System.String | contentType |
System.String | accept |
System.Action<System.Net.HttpWebRequest> | requestFilter |
System.Action<System.Net.HttpWebResponse> | responseFilter |
SendStringToUrlAsync(HttpWebRequest, String, String, String, String, Action<HttpWebRequest>, Action<HttpWebResponse>, CancellationToken)
View Source
public static async Task<string> SendStringToUrlAsync(HttpWebRequest webReq, string method, string requestBody, string contentType, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.String>
Parameters
Type | Name |
---|---|
System.Net.HttpWebRequest | webReq |
System.String | method |
System.String | requestBody |
System.String | contentType |
System.String | accept |
System.Action<System.Net.HttpWebRequest> | requestFilter |
System.Action<System.Net.HttpWebResponse> | responseFilter |
System.Threading.CancellationToken | token |
SerializeRequestToStream(Object, Stream, Boolean)
View Source
protected virtual void SerializeRequestToStream(object request, Stream requestStream, bool keepOpen = false)
Parameters
Type | Name |
---|---|
System.Object | request |
System.IO.Stream | requestStream |
System.Boolean | keepOpen |
SerializeToStream(IRequest, Object, Stream)
View Source
public abstract void SerializeToStream(IRequest req, object request, Stream stream)
Parameters
Type | Name |
---|---|
ServiceStack.Web.IRequest | req |
System.Object | request |
System.IO.Stream | stream |
SetBaseUri(String)
Sets all baseUri properties, using the Format property for the SyncReplyBaseUri and AsyncOneWayBaseUri
View Source
public void SetBaseUri(string baseUri)
Parameters
Type | Name | Description |
---|---|---|
System.String | baseUri | Base URI of the service |
|
SetCookie(String, String, Nullable<TimeSpan>)
View Source
public void SetCookie(string name, string value, TimeSpan? expiresIn = null)
Parameters
Type | Name |
---|---|
System.String | name |
System.String | value |
System.Nullable<System.TimeSpan> | expiresIn |
SetCredentials(String, String)
Sets the username and the password for basic authentication.
View Source
public void SetCredentials(string userName, string password)
Parameters
Type | Name |
---|---|
System.String | userName |
System.String | password |
ThrowResponseTypeException<TResponse>(Object, Exception, String)
View Source
protected void ThrowResponseTypeException<TResponse>(object request, Exception ex, string requestUri)
Parameters
Type | Name |
---|---|
System.Object | request |
System.Exception | ex |
System.String | requestUri |
Type Parameters
TResponse
ThrowWebServiceException<TResponse>(Exception, String)
View Source
public void ThrowWebServiceException<TResponse>(Exception ex, string requestUri)
Parameters
Type | Name |
---|---|
System.Exception | ex |
System.String | requestUri |
Type Parameters
TResponse
ToAbsoluteUrl(String)
View Source
public virtual string ToAbsoluteUrl(string relativeOrAbsoluteUrl)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | relativeOrAbsoluteUrl |
ToWebServiceException(WebException, Func<Stream, Object>, String)
View Source
public static WebServiceException ToWebServiceException(WebException webEx, Func<Stream, object> parseDtoFn, string contentType)
Returns
ServiceStack.WebServiceException
Parameters
Type | Name |
---|---|
System.Net.WebException | webEx |
System.Func<System.IO.Stream,System.Object> | parseDtoFn |
System.String | contentType |
UploadFile(WebRequest, Stream, String, String, String, Action<HttpWebRequest>, String, String)
View Source
public static void UploadFile(WebRequest webRequest, Stream fileStream, string fileName, string mimeType, string accept = null, Action<HttpWebRequest> requestFilter = null, string method = "POST", string fieldName = "file")
Parameters
Type | Name |
---|---|
System.Net.WebRequest | webRequest |
System.IO.Stream | fileStream |
System.String | fileName |
System.String | mimeType |
System.String | accept |
System.Action<System.Net.HttpWebRequest> | requestFilter |
System.String | method |
System.String | fieldName |
Implements
- ServiceStack.IServiceClient
- ServiceStack.IRestServiceClient
- ServiceStack.IServiceClientAsync
- ServiceStack.IServiceGatewayAsync
- ServiceStack.IServiceClientSync
- ServiceStack.IHasSessionId
- ServiceStack.IHasBearerToken
- ServiceStack.IHasVersion
- ServiceStack.IHttpRestClientAsync
- ServiceStack.IRestClientAsync
- ServiceStack.IReplyClient
- ServiceStack.IServiceGateway
- ServiceStack.IOneWayClient
- ServiceStack.IRestClient
- ServiceStack.IRestClientSync
- ServiceStack.IServiceClientCommon
- ServiceStack.Messaging.IMessageProducer
System.IDisposable
- ServiceStack.IHasCookieContainer
- ServiceStack.IServiceClientMeta