I want to get similarity between two paragraphs so not able to pass that through URL. So I am looking for method to post that two paragraph to check there similarity.
I am using C#. Below is my sample code that I suppose to work.
private static string GetSimilarityBydandelion(string oristr, string writtenstr)
{
var result = string.Empty;
myRequest.ContentType = "application/json";
myRequest.Method = "POST";
using (var streamWriter = new StreamWriter(myRequest.GetRequestStream()))
{
string json = "{\"text1\":\"" + oristr + "\"," +
"\"text2\":\"" + writtenstr + "\"}";
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
var ApiResponse = (HttpWebResponse)myRequest.GetResponse();
using (var streamReader = new StreamReader(ApiResponse.GetResponseStream()))
{
result = streamReader.ReadToEnd();
}
return result;
}