0
我有其他表单帖子可以正常工作,但由于某种原因,这一个用于引发“System.ArgumentException:值不在预期范围内”。信息。HttpClient.PostAsync - 为什么会抛出一个ArgumentException
什么可能是错的?
using (HttpClient client = new HttpClient())
{
HttpMultipartFormDataContent data = new HttpMultipartFormDataContent();
data.Add(new HttpStringContent(about ?? String.Empty), "about");
data.Add(new HttpStringContent(displayName ?? String.Empty), "name");
data.Add(new HttpStringContent(email ?? String.Empty), "email");
data.Add(new HttpStringContent(firstName ?? String.Empty), "firstName");
data.Add(new HttpStringContent(lastName ?? String.Empty), "lastName");
data.Add(new HttpStringContent(phone ?? String.Empty), "phone");
data.Add(new HttpStringContent(isPublic.ToString()), "isPublic");
data.Add(new HttpStringContent("true"), "isPrimaryProfile");
Uri uri = new Uri(url, UriKind.Absolute);
HttpResponseMessage responseMessage = await client.PostAsync(uri, data);
}
thx,想知道为什么我得到这个错误......;) – mech