python 链接sharepoint 2013 REST api
2015-06-02 18:39
681 查看
import requests,simplejson from requests_ntlm import HttpNtlmAuth p1 = requests.get("http://your_share_point_server_link/_api/Web/Lists(GUID ID#)/items", auth=HttpNtlmAuth('domain\\username','password'),headers={'accept': 'application/json;odata=verbose'}) print simplejson.dumps(simplejson.loads(simplejson.dumps(p1.json())))
关键是要用 requests_ntlm 来进行链接!
GUID ID#
http://<YOUR SERVER>/_api/web/lists
是个XML格式,你可以在里面查到guid id#
相关文章推荐
- Python中range和xrange的区别
- Ubuntu下配置Python数据分析环境
- Python爬虫之抓图
- pip安装psutil模块时候报错:yum install python-devel mysql-devel zlib-devel openssl-devel
- 程序语言 -- Python入门
- 程序语言 -- Python语法基础
- python urllib2设置代理下载页面
- Python安装pip
- python打包发布方法
- Python使用笔记
- python通过ssh-powershell监控windows的方法
- Python出现SyntaxError: Non-ASCII character '\xe7' in file 错误的解决办法
- python实例
- Python lxml模块安装教程
- Python里统计一个字符串中子字符串的个数
- Python脚本文件打包成可执行文件的方法
- python统计cpu利用率的方法
- Python2.x中文乱码问题解决方法
- python实现的守护进程(Daemon)用法实例
- Python中使用ElementTree解析XML示例