Client端发送请求, 要在发送请求的时候添加HTTP Basic Authentication认证信息到请求中,有两种方法:
1. 在请求头中添加Authorization:
    Authorization: "Basic 用户名和密码的base64字符串"
      其中, 用户名和密码中间先用:号隔开, 然后做base64编码, 如'Basic dGVzdDpwd2Q=' header的用户名为test, 密码为pwd
2. 在url中添加用户名和密码:
    http://userName:password@api.somesite.com/recent_events.xml

Server端验证逻辑, 通过检查 Authorization header的内容, 该header中包含用户名和密码信息, 然后验证用户名和密码, 如果没通过验证, 直接返回401 错误,

Python server实现
http://stackoverflow.com/questions/4287019/stuck-with-python-http-server-with-basic-authentication-using-basehttp
     
Basic authentication 客户端端示例 (使用 requests)   
http://docs.python-requests.org/en/master/user/authentication/

Basic authentication 客户端端示例 (使用 urllib2)
http://www.cnblogs.com/QLeelulu/archive/2009/11/22/1607898.html

HTTP Basic Authentication的更多相关文章

  1. Atitit HTTP 认证机制基本验证 (Basic Authentication) 和摘要验证 (Digest Authentication)attilax总结

    Atitit HTTP认证机制基本验证 (Basic Authentication) 和摘要验证 (Digest Authentication)attilax总结 1.1. 最广泛使用的是基本验证 ( ...

  2. Nancy 学习-身份认证(Basic Authentication) 继续跨平台

    开源 示例代码:https://github.com/linezero/NancyDemo 前面讲解Nancy的进阶部分,现在来学习Nancy 的身份认证. 本篇主要讲解Basic Authentic ...

  3. Web services 安全 - HTTP Basic Authentication

    根据 RFC2617 的规定,HTTP 有两种标准的认证方式,即,BASIC 和 DIGEST.HTTP Basic Authentication 是指客户端必须使用用户名和密码在一个指定的域 (Re ...

  4. Web API 基于ASP.NET Identity的Basic Authentication

    今天给大家分享在Web API下,如何利用ASP.NET Identity实现基本认证(Basic Authentication),在博客园子搜索了一圈Web API的基本认证,基本都是做的Forms ...

  5. PYTHON实现HTTP基本认证(BASIC AUTHENTICATION)

    参考: http://www.voidspace.org.uk/python/articles/authentication.shtml#id20 http://zh.wikipedia.org/wi ...

  6. HTTP Basic Authentication认证的各种语言 后台用的

    访问需要HTTP Basic Authentication认证的资源的各种语言的实现 无聊想调用下嘀咕的api的时候,发现需要HTTP Basic Authentication,就看了下. 什么是HT ...

  7. 一个HTTP Basic Authentication引发的异常

    这几天在做一个功能,其实很简单.就是调用几个外部的API,返回数据后进行组装然后成为新的接口.其中一个API是一个很奇葩的API,虽然是基于HTTP的,但既没有基于SOAP规范,也不是Restful风 ...

  8. HTTP Basic Authentication认证(Web API)

    当下最流行的Web Api 接口认证方式 HTTP Basic Authentication: http://smalltalllong.iteye.com/blog/912046 什么是HTTP B ...

  9. HTTP Basic Authentication认证

    http://smalltalllong.iteye.com/blog/912046 ******************************************** 什么是HTTP Basi ...

随机推荐

  1. 【poj1984】 Navigation Nightmare

    http://poj.org/problem?id=1984 (题目链接) 题意 给出一棵树,这棵树是以平面直角坐标系为基准建立的,也就是每个节点最多只有上下左右4条边.现在动态建树,同时询问两点间的 ...

  2. CSS3伪类选择器:nth-child()(nth-child(odd)/nth-child(even))

    nth-child(odd):奇数 nth-child(even):偶数 使用时,如果是精确到数字时,切记是从同一级别的元素开始计算,而不是指定某个类才开始计算. 比如: <li>< ...

  3. Spring BeanUtils的用法

    package test; import java.util.Date; import org.springframework.beans.BeanUtils; import test.basic.B ...

  4. codevs 1063 合并果子//优先队列

    1063 合并果子 2004年NOIP全国联赛普及组  时间限制: 1 s 空间限制: 128000 KB 题目等级 : 钻石    题目描述 Description 在一个果园里,多多已经将所有的果 ...

  5. 修改oracle系统用户system的密码

    C:\Users\Administrator>echo %ORACLE_SID% %ORACLE_SID% C:\Users\Administrator>set ORACLE_SID=or ...

  6. POJ - 2253 Frogger(Dijkstra变形题)

    题意: 题目撰写者的英语真是艰难晦涩,看了别人题解,才知道这题题意. 两个forger 一个froger 要蹦到另外一个froger处,他们的最短距离是这样定义的 : The frog distanc ...

  7. 我所了解的cgi

    http://www.cnblogs.com/liuzhang/p/3929198.html 当我们在谈到cgi的时候,我们在讨论什么 最早的Web服务器简单地响应浏览器发来的HTTP请求,并将存储在 ...

  8. wcf第1步

    添加System.ServiceModel 引用 Wcf 服务端 class Program { static void Main(string[] args) { ServiceHost host ...

  9. case when then else end

    1.根据数据库表中特定的值进行排序显示 select * from tablename where order by case when columname='' then 1 wnen column ...

  10. datatable group by

    对datatable 里面的数据按某一特定的栏位进行分组并且按照某一规则 var query = from t in rate.AsEnumerable()   group t by new { t1 ...