您好,登錄后才能下訂單哦!
using System; using System.Collections.Generic; using System.Linq; using System.Net.Http; using System.Text; using System.Threading.Tasks; using Newtonsoft.Json; namespace ConsoleApplication4 { class Program { static void Main(string[] args) { CreateHttpRequestMessage(); } public static HttpRequestMessage CreateHttpRequestMessage() { HttpRequestMessage requestMessage = new HttpRequestMessage(); JsonHSBCMailMessage JsonHsbcMailMessage = new JsonHSBCMailMessage { Host = "host111", Port = 1231312312 }; string Body = JsonConvert.SerializeObject(JsonHsbcMailMessage); requestMessage.Content = new StringContent(Body, Encoding.UTF8, "application/x-www-form-urlencoded"); return requestMessage; } } class JsonHSBCMailMessage { public string Host { get; set; } public int Port { get; set; } } }
* Newtonsoft.Json 需要自己下載并加載到引用列表
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。