我想通过基本身份验证在帖子网址中添加用户名和密码
答案 0 :(得分:0)
您未指定编程语言,但是如果您使用的是c#,它将是这样的:
HttpClient client = new HttpClient();
var byteArray = Encoding.ASCII.GetBytes("username:password");
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray));
client.PostAsync("http://IPaddress:port/F1/Details", yourcontent);