Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
ServiceStack/src/ServiceStack.Client/JsvServiceClient.cs
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
36 lines (28 sloc)
1017 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.IO; | |
using ServiceStack.Text; | |
using ServiceStack.Web; | |
namespace ServiceStack | |
{ | |
public class JsvServiceClient | |
: ServiceClientBase | |
{ | |
public override string Format => "jsv"; | |
public JsvServiceClient() {} | |
public JsvServiceClient(string baseUri) | |
{ | |
SetBaseUri(baseUri); | |
} | |
public JsvServiceClient(string syncReplyBaseUri, string asyncOneWayBaseUri) | |
: base(syncReplyBaseUri, asyncOneWayBaseUri) {} | |
public override string ContentType => $"application/{Format}"; | |
public override void SerializeToStream(IRequest req, object request, Stream stream) | |
{ | |
TypeSerializer.SerializeToStream(request, stream); | |
} | |
public override T DeserializeFromStream<T>(Stream stream) | |
{ | |
return TypeSerializer.DeserializeFromStream<T>(stream); | |
} | |
public override StreamDeserializerDelegate StreamDeserializer => TypeSerializer.DeserializeFromStream; | |
} | |
} |