case 4447

This commit is contained in:
2023-03-28 01:18:33 +00:00
parent 9ba5d027c7
commit 8d188108a7
5 changed files with 59 additions and 4 deletions

4
.vscode/launch.json vendored
View File

@@ -10,7 +10,7 @@
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/bin/Debug/net5.0/contact.dll",
"program": "${workspaceFolder}/bin/Debug/net6.0/contact.dll",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
@@ -20,7 +20,7 @@
"args": "${auto-detect-url}",
"windows": {
"command": "cmd.exe",
"args": "/C start http://localhost:3002/contact"
"args": "/C start http://localhost:3002/request"
},
"osx": {
"command": "open"

View File

@@ -97,12 +97,53 @@ namespace contact.Pages
}
}
PostRequestToSockeye();
SendMail();
skipspam:
return Redirect("https://ayanova.com/docs/ay-evaluate/");
}
private void PostRequestToSockeye()
{
using var client = new HttpClient();
//client.BaseAddress = new System.Uri("https://sockeye.ayanova.com");///api/v8.0/subscription-server/
var r = new
{
dataCenter = SubRequest.DataCenter,
email = SubRequest.Email,
company = SubRequest.Company,
name = SubRequest.Name,
rValue = "totallylegit"
};
HttpContent body = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(r),
System.Text.Encoding.UTF8,
"application/json");
var response = client.PostAsync("https://sockeye.ayanova.com/subscription-server-trial-request", body).Result;
//var response = client.PostAsync("http://localhost:7676/subscription-server-trial-request", body).Result;
// if (response.IsSuccessStatusCode)
// {
// var content = await response.Content.ReadAsStringAsync();
// if (!string.IsNullOrEmpty(content))
// {
// var objDeserializeObject = JsonConvert.DeserializeObject<SongsModel>(content);
// Console.WriteLine("Data Saved Successfully.");
// if (objDeserializeObject != null)
// {
// Console.WriteLine(objDeserializeObject.Name);
// }
// }
// }
}
private void SendMail()
{

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<ItemGroup>

3
notes
View File

@@ -27,3 +27,6 @@ copy up to server
systemctl status kestrel-contact.service
systemctl start kestrel-contact.service
systemctl stop kestrel-contact.service

11
rest-test.http Normal file
View File

@@ -0,0 +1,11 @@
POST https://sockeye.ayanova.com/subscription-server-trial-request HTTP/1.1
content-type: application/json
{
"dataCenter":"SubRequest.DataCenter",
"email":"SubRequest.Email",
"company":"SubRequest.Company",
"name":"SubRequest.Name",
"rValue":"totallylegit"
}