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) });
protected ApiRequestHandlerBase(ApiMethodReturnType methodReturnType, HttpClient httpClient) { _httpClient = httpClient; MethodReturnType = methodReturnType; }
public ReturnTypeNotSupportedException(ApiMethodReturnType returnType) : base($"Return type '{returnType}' is not supported") { }
protected XmlRpcRequestHandlerBase(ApiMethodReturnType returnType) { ReturnType = returnType; }