예제 #1
0
 private static HttpCompletionOption GetDefaultCompletionOption(ApiMethodReturnType apiMethodReturnType)
 {
     return(apiMethodReturnType switch
     {
         ApiMethodReturnType.Void => HttpCompletionOption.ResponseHeadersRead,
         ApiMethodReturnType.HttpResponseMessage => HttpCompletionOption.ResponseHeadersRead,
         ApiMethodReturnType.String => HttpCompletionOption.ResponseContentRead,
         ApiMethodReturnType.Stream => HttpCompletionOption.ResponseHeadersRead,
         ApiMethodReturnType.DataObject => HttpCompletionOption.ResponseContentRead,
         ApiMethodReturnType.Response => HttpCompletionOption.ResponseHeadersRead,
         _ => throw new ArgumentOutOfRangeException(nameof(apiMethodReturnType), apiMethodReturnType, null)
     });
예제 #2
0
 protected ApiRequestHandlerBase(ApiMethodReturnType methodReturnType, HttpClient httpClient)
 {
     _httpClient      = httpClient;
     MethodReturnType = methodReturnType;
 }
예제 #3
0
 public ReturnTypeNotSupportedException(ApiMethodReturnType returnType)
     : base($"Return type '{returnType}' is not supported")
 {
 }
예제 #4
0
 protected XmlRpcRequestHandlerBase(ApiMethodReturnType returnType)
 {
     ReturnType = returnType;
 }