Created
November 26, 2018 15:30
-
-
Save kenny-evitt/9c55302121127f7f9b015f9482a95716 to your computer and use it in GitHub Desktop.
Revisions
-
kenny-evitt created this gist
Nov 26, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,38 @@ bool CallGenerateImageOfFirstPageWebMethod(int documentLocationId) { HttpWebRequest request = (HttpWebRequest)WebRequest.Create( String.Format( "http://snyiis1/Apps/documents/{0}/generate-preview-image", documentLocationId)); request.Method = "POST"; request.ContentLength = 0; HttpWebResponse response = null; string responseContent = null; try { response = (HttpWebResponse)request.GetResponse(); using (StreamReader responseStreamReader = new StreamReader(response.GetResponseStream())) { responseContent = responseStreamReader.ReadToEnd(); } } catch (Exception ex) { ex.Dump(); response.Dump(); responseContent.Dump(); return false; } return response != null && response.StatusCode == HttpStatusCode.OK && responseContent == "{\"status\":\"true\"}"; }