我在谷歌和這里搜索,但我遇到了奇怪的情況。
我需要制作一個 API,從另一個服務中獲取資料,在那里我將鏈接粘貼到我的 API。
鏈接應該是:
1: https://myAPI/xxx/xxxx/optincallbackurl.php?email=$email$&key=sha1($email$security_parameter)
2: https://myAPI/xxx/xxxx/optincallbackurl.php?email=$email$&key=sha1($email$security_parameter)
2 個選項中的服務給我發送電子郵件。如何接收這些資料?c# 中的普通 POST 方法 API 應該適用于該回呼嗎?
uj5u.com熱心網友回復:
我尋求建議如何從 URI 制作接收器,我在下面解決了我的問題代碼。
public class Kontakt
{
public string kEmail { get; set; }
}
public class optoutcallbackurlController : ApiController
{
public void Post([FromUri]string email)
{
Kontakt kontakt = new Kontakt();
kontakt.kEmail = email;
}
}
現在我得到了像 myAPI/conroler?email="[email protected]" 這樣的鏈接,我收到了從 URI 到我的 API 的電子郵件。
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/373520.html
上一篇:如何在URI中轉義花括號
