HttpListener: how to get http user and password?

后端 未结 3 1211
执笔经年
执笔经年 2021-02-19 18:02

I\'m facing a problem here, with HttpListener.

When a request of the form

http://user:password@example.com/

is made, how can I get the

3条回答
  •  广开言路
    2021-02-19 18:32

    Get the Authorization header. It's format is as follows

    Authorization:  
    

    Example:

    Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
    

    The username and password is colon-seperated (in this example, Aladdin:open sesame), then B64-encoded.

提交回复
热议问题