Nancy (C#): How do I get my post data?

后端 未结 5 625
情书的邮戳
情书的邮戳 2021-02-07 01:29

I\'m using Corona SDK to post data to my C# server:

headers[\"Content-Type\"] = \"application/x-www-form-urlencoded\"
headers[\"Accept-Language\"] = \"en-US\"

l         


        
5条回答
  •  孤街浪徒
    2021-02-07 02:20

    This actually works great:

    var body = this.Request.Body; 
    int length = (int) body.Length; // this is a dynamic variable
    byte[] data = new byte[length]; 
    body.Read(data, 0, length);             
    Console.WriteLine(System.Text.Encoding.Default.GetString(data));
    

提交回复
热议问题