HttpClient setting boundary with content-type

后端 未结 3 841
野的像风
野的像风 2021-01-13 02:09

I am using javascript to communicate with a third party service. As part of their authentication process they need the \"multipart/form\" body of the post message including

3条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-13 02:52

    with HttpClient

     request.Content.Headers.Add("ContentType", "multipart/form-data, boundary=------------ThIs_Is_tHe_bouNdaRY_");
    

    you can use HttpWebRequest

     myHttpWebRequest.Date = DateTime.Now;
     myHttpWebRequest.ContentType = "multipart/form-data, boundary=------------ThIs_Is_tHe_bouNdaRY_";
    

提交回复
热议问题