Parse POST parameters from HttpListener

后端 未结 2 425
遥遥无期
遥遥无期 2021-01-14 02:13

Let\'s say i have HttpListener. It listen some port and ip. When i send POST request it catch it. How can i parse POST parameters from HttpListenerRequest?

H         


        
2条回答
  •  长发绾君心
    2021-01-14 02:44

    The POST body (read from the InputStream on the HttpListenerRequest) is parsed using whatever mechanism you choose to encode the POST data with.

    For example, you could be sending JSON using JSON.stringify calls on a JavaScript object in a browser. In that case you could use the JSON deserializer in .Net or JSON.Net.

    Or, you might choose to send XML, or CSV, or something else entirely.

    Hope that helps - Harold

提交回复
热议问题