Last post Jan 01, 2021 02:46 AM by Rena Ni
Dec 31, 2020 09:47 PM|andrewcw|LINK
Hi I have one sight where I want to check the post logic . Both at this point are just VS projects.
If I start both projects I have one on https://localhost:44326/ and the other at 44390
However when I try to post data within the app or go external to the web at 44390 ( throws error as shown )
Question - is it possible to test this way ? If so how ?
using (var client = new HttpClient())
client.BaseAddress = new Uri("http://localhost:44390"); // what happens if create another client with new #
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12; // saw his on stack overflow but made no difference
var content = new FormUrlEncodedContent(new
new KeyValuePair<string, string>("bigString", "abcd- I am a big string")
var result = await client.PostAsync("index", content); // await client.PostAsync("~/RecPost", content);
string resultContent = await result.Content.ReadAsStringAsync();
Jan 01, 2021 02:46 AM|Rena Ni|LINK
It could work well in my project.For this issue,I think you need check the url,I think it should be
https://localhost:44390 not http://localhost:44390.