public void RecognizeTextDefault() { RequestInfo = new RestRequestInfo(RestSharp.Method.POST, String.Format("{0}/{1}?", SubscriptionEndpoint, "recognizeText")); Parameters = new Dictionary <string, string> { { "handwriting", "true" }, }; Headers = new Dictionary <string, string> { { "Ocp-Apim-Subscription-Key", SubscriptionKey }, { "Content-Type", "application/octet-stream" }, }; }
public RestSharp.RestRequest CreateRequest(RestRequestInfo req, Dictionary <string, string> headers, Dictionary <string, string> parameters) { Request = new RestSharp.RestRequest(req.Root, req.Method); if (headers != null) { foreach (var head in headers) { Request.AddHeader(head.Key, head.Value); } } if (parameters != null) { foreach (var param in parameters) { Request.AddParameter(param.Key, param.Value); } } return(Request); }