public OcrSdkTask GetTaskStatus(TaskId task) { string url = String.Format("{0}getTaskStatus?taskId={1}", ServerUrl, Uri.EscapeDataString(task.ToString())); WebRequest request = createGetRequest(url); XDocument response = performRequest(request); OcrSdkTask serverTask = ServerXml.GetTaskStatus(response); return(serverTask); }
/// <summary> /// Upload image of a multipage document to server. /// </summary> /// <param name="filePath">Path to an image to process</param> /// <param name="taskToAddFile">Id of multipage document. If null, a new document is created</param> /// <returns>Id of document to which image was added</returns> public OcrSdkTask UploadAndAddFileToTask(string filePath, TaskId taskToAddFile) { string url = String.Format("{0}submitImage", ServerUrl); if (taskToAddFile != null) { url = url + "?taskId=" + Uri.EscapeDataString(taskToAddFile.ToString()); } // Build post request WebRequest request = createPostRequest(url); writeFileToRequest(filePath, request); XDocument response = performRequest(request); OcrSdkTask task = ServerXml.GetTaskStatus(response); return(task); }