HTTP Basic Authentication认证资源代码

这两天和同事遇到了HTTP Basic Authentication认证的问题,比如说调用新浪微博的API。于是在网上搜罗到这篇文章,贴出来与大家一同分享。