Ejemplo n.º 1
0
 internal RpcClient(Uri baseUrl,
                    IRpcTransportClient transportClient,
                    IRequestSerializer requestSerializer,
                    RpcEvents events)
 {
     this.BaseUrl           = baseUrl;
     this.transportClient   = transportClient ?? throw new ArgumentNullException(nameof(transportClient));
     this.requestSerializer = requestSerializer ?? throw new ArgumentNullException(nameof(requestSerializer));
     this.Events            = events ?? throw new ArgumentNullException(nameof(events));
 }
Ejemplo n.º 2
0
 /// <param name="baseUrl">Base url for the rpc server</param>
 /// <param name="authHeaderValue">Http authentication header for rpc request</param>
 /// <param name="jsonSerializer">(Optional) Json serializer for serializing requests and deserializing responses. Defaults to built in serializer</param>
 /// <param name="encoding">(Optional)Encoding type for request. Defaults to UTF-8</param>
 /// <param name="contentType">(Optional)Content type header for the request. Defaults to application/json</param>
 /// <param name="headers">(Optional)Extra headers</param>
 public RpcClient(Uri baseUrl,
                  IRequestSerializer jsonSerializer   = null,
                  IRpcTransportClient transportClient = null,
                  RpcEvents events = null)
 {
     this.BaseUrl         = baseUrl;
     this.JsonSerializer  = jsonSerializer ?? new DefaultRequestJsonSerializer();
     this.TransportClient = transportClient ?? new HttpRpcTransportClient();
     this.Events          = events ?? new RpcEvents();
 }