ASP.NET Equivalent to this cURL command

前端 未结 2 826
情深已故
情深已故 2021-01-18 04:05

I\'m working with the Twilio API and it provides examples in PHP and Ruby. I\'m working on a site to send text messages through the API that\'s coded in ASP.NET MVC 3, and u

相关标签:
2条回答
  • 2021-01-18 04:32

    The -u option in Curl is to specify a username and password for Server Authentication.

    For C# this is set using the WebRequest.Credentials property.

    0 讨论(0)
  • 2021-01-18 04:46

    Try including

     request.Method = "POST";
    

    and

    request.Credentials = new NetworkCredential("username", "password");
    
    0 讨论(0)
提交回复
热议问题