Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        /// <exception cref="ProWritingAid.SDK.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="requestp"></param>
        /// <returns>Task of AsyncResponseHtmlAnalysisResponse</returns>
        public async System.Threading.Tasks.Task <AsyncResponseHtmlAnalysisResponse> PostAsync(HtmlAnalysisRequest requestp)
        {
            ApiResponse <AsyncResponseHtmlAnalysisResponse> localVarResponse = await PostAsyncWithHttpInfo(requestp);

            return(localVarResponse.Data);
        }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <exception cref="ProWritingAid.SDK.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="requestp"></param>
        /// <returns>Task of ApiResponse (AsyncResponseHtmlAnalysisResponse)</returns>
        public async System.Threading.Tasks.Task <ApiResponse <AsyncResponseHtmlAnalysisResponse> > PostAsyncWithHttpInfo(HtmlAnalysisRequest requestp)
        {
            // verify the required parameter 'requestp' is set
            if (requestp == null)
            {
                throw new ApiException(400, "Missing required parameter 'requestp' when calling HtmlApi->Post");
            }

            var    localVarPath         = "/api/async/html";
            var    localVarPathParams   = new Dictionary <String, String>();
            var    localVarQueryParams  = new Dictionary <String, String>();
            var    localVarHeaderParams = new Dictionary <String, String>(Configuration.DefaultHeader);
            var    localVarFormParams   = new Dictionary <String, String>();
            var    localVarFileParams   = new Dictionary <String, FileParameter>();
            Object localVarPostBody     = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
                "application/json",
                "text/json",
                "application/x-www-form-urlencoded"
            };
            String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json",
                "text/json"
            };
            String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);

            if (localVarHttpHeaderAccept != null)
            {
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
            }

            if (requestp != null && requestp.GetType() != typeof(byte[]))
            {
                localVarPostBody = Configuration.ApiClient.Serialize(requestp); // http body (model) parameter
            }
            else
            {
                localVarPostBody = requestp; // byte array
            }

            // authentication (licenseCode) required
            if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("licenseCode")))
            {
                localVarHeaderParams["licenseCode"] = Configuration.GetApiKeyWithPrefix("licenseCode");
            }

            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath,
                                                                                                       Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                                                                                                       localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int)localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("Post", localVarResponse);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(new ApiResponse <AsyncResponseHtmlAnalysisResponse>(localVarStatusCode,
                                                                       localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                                                                       (AsyncResponseHtmlAnalysisResponse)Configuration.ApiClient.Deserialize(localVarResponse, typeof(AsyncResponseHtmlAnalysisResponse))));
        }
Esempio n. 3
0
        /// <summary>
        ///
        /// </summary>
        /// <exception cref="ProWritingAid.SDK.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="requestp"></param>
        /// <returns>AsyncResponseHtmlAnalysisResponse</returns>
        public AsyncResponseHtmlAnalysisResponse Post(HtmlAnalysisRequest requestp)
        {
            ApiResponse <AsyncResponseHtmlAnalysisResponse> localVarResponse = PostWithHttpInfo(requestp);

            return(localVarResponse.Data);
        }