- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在关注这个Guide尝试使用 python 连接到共享点站点并使用 REST api 获取一些数据。但是,我在使用 JSON 解码器时一直遇到问题,无法按照指南中的建议读取数据。
我严格按照指南进行操作,但仍然遇到同样的问题。我尝试将标题更改为 headers = {'content-type':'application/json'}
正如它对此处提出的另一个问题所暗示的那样;但没有任何效果。
这就是我到目前为止所拥有的,就像指南所建议的那样:
import requests
from requests_ntlm import HttpNtlmAuth
headers = {"accept": "application/json;odata=verbose"}
response = requests.get("http://Sharepointsite/_api/web/", auth=HttpNtlmAuth('User','Pass'),headers=headers)
print(response.content)
print(response.json()["d"]["CustomMasterUrl"])
这是我收到的错误消息:
Traceback (most recent call last):
File "C:/Users/User/MyProjects/ProductivityTracking/SharepointConnection/Sharepoint Integration.py", line 9, in <module>
print (response.json()["d"]["CustomMasterUrl"])
File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\site-packages\requests\models.py", line 897, in json
return complexjson.loads(self.text, **kwargs)
File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\json\__init__.py", line 348, in loads
return _default_decoder.decode(s)
File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 2 column 1 (char 2)
如果你们能给我指出正确的方向来开始解决这个问题,那就太棒了 - 我在堆栈和其他地方进行了搜索。
附加信息 - 响应内容:
b'\r\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"\r\n\t"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r\n<html dir="ltr" lang="en-US">\r\n<head><meta name="GENERATOR" content="Microsoft SharePoint" /><meta http-equiv="Content-type" content="text/html; charset=utf-8" /><meta http-equiv="X-UA-Compatible" content="IE=10" /><meta http-equiv="Expires" content="Fri, 11 Oct 2019 15:09:01 GMT" /><meta name="msapplication-TileImage" content="/_layouts/15/images/SharePointMetroAppTile.png" /><meta name="msapplication-TileColor" content="#0072C6" /><link rel="shortcut icon" href="/_layouts/15/images/favicon.ico?rev=23" type="image/vnd.microsoft.icon" id="favicon" />\r\n<script type=\'text/javascript\'>\r\n// <![CDATA[\r\nvar url = window.location.href; var g_initUrl=\'\';\r\nvar hashSaverUrl = \'\';var keyName = \'MDSLoginAllowedUrl\';var idx = url.indexOf(\'&\' + keyName + \'=\');\r\nif (idx != -1) {\r\n var idx2 = url.indexOf(\'&\', idx + 1);\r\n if (idx2 == -1)\r\n idx2 = url.length;\r\n hashSaverUrl = url.substring(idx + keyName.length + 2, idx2);\r\n hashSaverUrl = decodeURIComponent(hashSaverUrl);\r\n}\r\nif (!hashSaverUrl || hashSaverUrl == \'\') {\r\n var g_MDSStartTime = new Date();\r\n var g_MinimalDownload = true;var g_mdsReady=false;var isStartPlt1 = true;var startDate = g_MDSStartTime.valueOf().toString();\r\n var skipOverlay=true;var startRenderComplete=false;var initContentComplete=false;\r\n var hashParts=window.location.hash.substr(1).split(\'#\');var ch=hashParts[0];var localAnc=null; \r\n for (var i=1;i<hashParts.length;i++){\r\n var s=hashParts[i];\r\n if (s.indexOf(\'=\') == -1) {\r\n localAnc=s; \r\n break;\r\n }\r\n }\r\n\r\n var requestUrlFull;\r\n if (ch.length >= 2 && ch[0] === \'/\' && ch[1] === \'/\')\r\n {\r\n if (ch[2] !== \'/\')\r\n {\r\n g_initUrl = ch.substr(1);\r\n requestUrlFull = window.location.hash.substr(2);\r\n }\r\n } else if (typeof(ch) != \'undefined\' && ch.length >= 1 && ch[0] === \'/\')\r\n {\r\n var loc = window.location.pathname;\r\n var pos = loc.indexOf(\'/_layouts/15/start.aspx\');\r\n var hash = window.location.hash.substr(1);\r\n var hPos = hash.indexOf(\'#\');\r\n hPos = hPos >= 0 ? hPos : hash.length;\r\n g_initUrl = loc.substr(0, pos) + ch;\r\n requestUrlFull = g_initUrl + hash.substr(hPos);\r\n }\r\n\r\n if(g_initUrl){\r\n var delim=ch.indexOf(\'?\')!=-1 ? \'&\' : \'?\';\r\n var xhr=new XMLHttpRequest();\r\n xhr.open(\'GET\',g_initUrl+delim+\'AjaxDelta=1&isStartPlt1=\' + startDate, true);\r\n xhr.setRequestHeader(\'Pragma\', \'SharePointAjaxDelta=|SITES|SANDBOX:|SITES|SANDBOX|_CATALOGS|MASTERPAGE|SEATTLE.MASTER:2.15.0.0.0.15.0.5131.1000.0.FALSE.:en-US:en-US:RW\');\r\n xhr.onreadystatechange=function(){\r\n if(xhr.readyState==4){\r\n if(g_mdsReady){\r\n asyncDeltaManager._navigate(requestUrlFull, localAnc);}\r\n else\r\n {g_mdsReady=true;}}};\r\n xhr.send(null);}\r\n else\r\n {g_mdsReady=true;}\r\n}\r\n\r\n// ]]>\r\n</script>\r\n<link rel="stylesheet" type="text/css" href="/_layouts/15/1033/styles/Themable/corev15.css?rev=2bpHeX9U8DH09TB5zpJcsQ%3D%3D"/>\n<script type="text/javascript" src="/_layouts/15/init.js?rev=ZwTQYqYlNTyyuMWaLlhwSg%3D%3D"></script>\n<script type="text/javascript" src="/ScriptResource.axd?d=ideow4fpAMtT1LU3KRk4QdrhD1jlPBAePc9i8Ib6lUnFTPWZBlpLxAiBo8ORwOMMJgN20_t9vRkidn1TCfn8SlPTG2UqSNGHdiXmH-2qG7qawwjHGYQutflvf9Bq4OfLRdTYGOD6T8DyvDQ6rrD3oPhj_zf3sNcoJxJOKX0a2n2TdJGcEtmFj3kTppa6_7PE0&t=ffffffffc60ca17c"></script>\n<script type="text/javascript" src="/_layouts/15/blank.js?rev=ZaOXZEobVwykPO9g8hq%2F8A%3D%3D"></script>\n<script type="text/javascript" src="/_layouts/15/start.js?rev=RJ1wZoVJ%2F7xfKjfBnjaWng%3D%3D"></script>\n<script type="text/javascript">RegisterSod("initstrings.js", "\\u002f_layouts\\u002f15\\u002f1033\\u002finitstrings.js?rev=S11vfGURQYVuACMEY0tLTg\\u00253D\\u00253D");</script>\n<script type="text/javascript">RegisterSod("strings.js", "\\u002f_layouts\\u002f15\\u002f1033\\u002fstrings.js?rev=0Q8SquDYHrVJnF3A1pfsSQ\\u00253D\\u00253D");RegisterSodDep("strings.js", "initstrings.js");</script>\n<script type="text/javascript">RegisterSod("sp.init.js", "\\u002f_layouts\\u002f15\\u002fsp.init.js?rev=jvJC3Kl5gbORaLtf7kxULQ\\u00253D\\u00253D");</script>\n<script type="text/javascript">RegisterSod("sp.res.resx", "\\u002f_layouts\\u002f15\\u002fScriptResx.ashx?culture=en\\u00252Dus\\u0026name=SP\\u00252ERes\\u0026rev=yNk\\u00252FhRzgBn40LJVP\\u00252BqfgdQ\\u00253D\\u00253D");</script>\n<script type="text/javascript">RegisterSod("sp.ui.dialog.js", "\\u002f_layouts\\u002f15\\u002fsp.ui.dialog.js?rev=3Oh2QbaaiXSb7ldu2zd6QQ\\u00253D\\u00253D");RegisterSodDep("sp.ui.dialog.js", "sp.init.js");RegisterSodDep("sp.ui.dialog.js", "sp.res.resx");</script>\n<script type="text/javascript">RegisterSod("core.js", "\\u002f_layouts\\u002f15\\u002fcore.js?rev=GpU7vxyOqzS0F9OfEX3CCw\\u00253D\\u00253D");RegisterSodDep("core.js", "strings.js");</script>\n<script type="text/javascript">RegisterSod("menu.js", "\\u002f_layouts\\u002f15\\u002fmenu.js?rev=cXv35JACAh0ZCqUwKU592w\\u00253D\\u00253D");</script>\n<script type="text/javascript">RegisterSod("mQuery.js", "\\u002f_layouts\\u002f15\\u002fmquery.js?rev=VYAJYBo5H8I3gVSL3MzD6A\\u00253D\\u00253D");</script>\n<script type="text/javascript">RegisterSod("callout.js", "\\u002f_layouts\\u002f15\\u002fcallout.js?rev=ryx2n4ePkYj1\\u00252FALmcsXZfA\\u00253D\\u00253D");RegisterSodDep("callout.js", "strings.js");RegisterSodDep("callout.js", "mQuery.js");RegisterSodDep("callout.js", "core.js");</script>\n<script type="text/javascript">RegisterSod("clienttemplates.js", "\\u002f_layouts\\u002f15\\u002fclienttemplates.js?rev=OJfMNjaofDqyBzPvjPo3XA\\u00253D\\u00253D");RegisterSodDep("clienttemplates.js", "initstrings.js");</script>\n<script type="text/javascript">RegisterSod("sharing.js", "\\u002f_layouts\\u002f15\\u002fsharing.js?rev=XxxHIxIIc8BsW9ikVc6dgA\\u00253D\\u00253D");RegisterSodDep("sharing.js", "strings.js");RegisterSodDep("sharing.js", "mQuery.js");RegisterSodDep("sharing.js", "clienttemplates.js");RegisterSodDep("sharing.js", "core.js");</script>\n<script type="text/javascript">RegisterSod("suitelinks.js", "\\u002f_layouts\\u002f15\\u002fsuitelinks.js?rev=REwVU5jSsadDdOZlCx4wpA\\u00253D\\u00253D");RegisterSodDep("suitelinks.js", "strings.js");RegisterSodDep("suitelinks.js", "core.js");</script>\n<link type="text/xml" rel="alternate" href="/sites/sandbox/_vti_bin/spdisco.aspx" /></head>\r\n<body>\r\n <div id="imgPrefetch" style="display:none">\r\n</div>\r\n\r\n <noscript><div class=\'noindex\'>You may be trying to access this site from a secured browser on the server. Please enable scripts and reload this page.</div></noscript>\r\n \r\n <form method="post" action="./start.aspx" id="aspnetForm" onsubmit="if (typeof(_spFormOnSubmitWrapper) == "function") return _spFormOnSubmitWrapper();">\r\n<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMTY1NDU2MTA1Mg9kFgJmD2QWAgIBD2QWAgIJDxYCHghvbnN1Ym1pdAVSaWYgKHR5cGVvZihfc3BGb3JtT25TdWJtaXRXcmFwcGVyKSA9PSAiZnVuY3Rpb24iKSByZXR1cm4gX3NwRm9ybU9uU3VibWl0V3JhcHBlcigpO2Rk82P14L36F04gkzB9Q1Z5k5kq+AtfmPqNYl/2Da94T8s=" />\r\n\r\n\r\n<script type="text/javascript">\r\n//<![CDATA[\r\nvar g_presenceEnabled = true;\nvar g_wsaEnabled = false;\nvar g_wsaQoSEnabled = false;\nvar g_wsaQoSDataPoints = [];\nvar g_wsaLCID = 1033;\nvar g_wsaListTemplateId = null;\nvar _fV4UI=true;var _spPageContextInfo = {webServerRelativeUrl: "\\u002fsites\\u002fsandbox", webAbsoluteUrl: "http:\\u002f\\u002fhemportal.hem.jmhuber.com\\u002fsites\\u002fsandbox", siteAbsoluteUrl: "http:\\u002f\\u002fhemportal.hem.jmhuber.com\\u002fsites\\u002fsandbox", serverRequestPath: "\\u002f_layouts\\u002f15\\u002fstart.aspx", layoutsUrl: "_layouts\\u002f15", webTitle: "", webTemplate: "", tenantAppVersion: "none", isAppWeb: false, Has2019Era: true, webLogoUrl: "_layouts\\u002f15\\u002fimages\\u002fsiteicon.png", webLanguage: 1033, currentLanguage: 1033, currentUICultureName: "en-US", currentCultureName: "en-US", clientServerTimeDelta: new Date("2019-09-11T15:09:01.6585779Z") - new Date(), siteClientTag: "0$$15.0.5131.1000", crossDomainPhotosEnabled:false, webUIVersion:15, webPermMasks:{High:0,Low:0}, pagePersonalizationScope:1, alertsEnabled:true, customMarkupInCalculatedFieldDisabled: true, siteServerRelativeUrl: "\\u002fsites\\u002fsandbox", allowSilverlightPrompt:\'True\'};var MSOWebPartPageFormName = \'aspnetForm\';//]]>\r\n</script>\r\n\r\n<script src="/_layouts/15/blank.js?rev=ZaOXZEobVwykPO9g8hq%2F8A%3D%3D" type="text/javascript"></script>\r\n<script type="text/javascript">\r\n//<![CDATA[\r\nif (typeof(DeferWebFormInitCallback) == \'function\') DeferWebFormInitCallback();//]]>\r\n</script>\r\n\r\n<input type="hidden" name="__VIEWSTATEGENERATOR" id="__VIEWSTATEGENERATOR" value="A31D3FD9" />\r\n\t<script type="text/javascript"> var submitHook = function () { return false; }; theForm._spOldSubmit = theForm.submit; theForm.submit = function () { if (!submitHook()) { this._spOldSubmit(); } }; </script>\r\n\t<span id="DeltaSPWebPartManager"></span>\r\n\t\r\n\t<span id="DeltaDelegateControls"></span>\r\n<div id="TurnOnAccessibility" style="display:none" class="s4-notdlg noindex">\r\n\t<a id="linkTurnOnAcc" href="#" class="ms-accessible ms-acc-button" onclick="SetIsAccessibilityFeatureEnabled(true);UpdateAccessibilityUI();document.getElementById(\'linkTurnOffAcc\').focus();return false;">Turn on more accessible mode</a>\r\n</div>\r\n<div id="TurnOffAccessibility" style="display:none" class="s4-notdlg noindex">\r\n\t<a id="linkTurnOffAcc" href="#" class="ms-accessible ms-acc-button" onclick="SetIsAccessibilityFeatureEnabled(false);UpdateAccessibilityUI();document.getElementById(\'linkTurnOnAcc\').focus();return false;">Turn off more accessible mode</a>\r\n</div>\r\n<div class="s4-notdlg s4-skipribbonshortcut noindex">\r\n\t<a href="javascript:;" onclick="document.getElementById('startNavigation').focus();" class="ms-accessible ms-acc-button" accesskey="Y">Skip Ribbon Commands</a>\r\n</div>\r\n<div class="s4-notdlg noindex">\r\n\t<a href="javascript:;" onclick="document.getElementById('mainContent').focus();" class="ms-accessible ms-acc-button">Skip to main content</a>\r\n</div>\r\n<div id="TurnOffAnimation" style="display:none;" class="s4-notdlg noindex">\r\n\t<a id="linkTurnOffAnimation" href="#" class="ms-accessible ms-acc-button" onclick="ToggleAnimationStatus();return false;">Turn off Animations</a>\r\n</div>\r\n<div id="TurnOnAnimation" style="display:none;" class="s4-notdlg noindex">\r\n\t<a id="linkTurnOnAnimation" href="#" class="ms-accessible ms-acc-button" onclick="ToggleAnimationStatus();return false;">Turn on Animations</a>\r\n</div>\r\n<a id="HiddenAnchor" href="javascript:;" style="display:none;"></a>\r\n<div id="suiteBar" class="ms-dialogHidden noindex">\r\n\t<div id="suiteBarLeft">\r\n\t\t<div class="ms-table ms-fullWidth">\r\n\t\t\t<div class="ms-tableRow">\r\n\t\t\t\t<div class="ms-tableCell ms-verticalAlignMiddle">\r\n\t\t\t\t\t\r\n\t\t\t\t</div>\r\n\t\t\t\t<div id="DeltaSuiteLinks" class="ms-core-deltaSuiteLinks">\r\n\r\n</div>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t</div>\r\n\t<div id="suiteBarRight">\r\n\t\t<div id="DeltaSuiteBarRight" class="ms-core-deltaSuiteBarRight">\r\n\r\n</div>\r\n\t</div>\r\n</div>\r\n\t\t<div id="ms-hcTest"></div>\r\n\t\t<div id="s4-ribbonrow">\r\n\t\t<div id="globalNavBox" class="noindex">\r\n<div id="ribbonBox">\r\n\t<div id="s4-ribboncont">\r\n\t\t<div id="DeltaSPRibbon">\r\n\r\n</div>\r\n\t</div>\r\n\t<span id="DeltaSPNavigation"></span>\r\n</div>\r\n<div id="DeltaWebPartAdderUpdatePanelContainer" class="ms-core-webpartadder">\r\n\r\n</div>\r\n\t\t</div>\r\n\t\t</div>\r\n\t\t<div id="s4-workspace" class="ms-core-overlay">\r\n\t\t<div id="s4-bodyContainer">\r\n\t\t<div id="s4-titlerow"\r\n\t\t\tclass="ms-dialogHidden s4-titlerowhidetitle">\r\n\t\t<div id="titleAreaBox"\r\n\t\t\tclass="ms-noList ms-table ms-core-tableNoSpace">\r\n\t\t<div id="titleAreaRow"\r\n\t\t\tclass="ms-tableRow">\r\n<div id="siteIcon" class="ms-tableCell ms-verticalAlignTop">\r\n\t<div id="DeltaSiteLogo">\r\n\r\n</div>\r\n</div>\r\n\t\t\t<div class="ms-breadcrumb-box ms-tableCell ms-verticalAlignTop">\r\n\t\t\t\t<div\r\n\t\t\t\t\tclass="ms-breadcrumb-top">\r\n<div class="ms-breadcrumb-dropdownBox" style="display:none;">\r\n<span id="DeltaBreadcrumbDropdown"></span>\r\n</div>\r\n<div id="DeltaTopNavigation" class="ms-displayInline ms-core-navigation" role="navigation">\r\n\r\n</div>\r\n\t\t\t\t</div>\r\n<h1 id="pageTitle" class="ms-core-pageTitle">\r\n <span id="DeltaPlaceHolderPageTitleInTitleArea"></span>\r\n <div id="DeltaPlaceHolderPageDescription" class="ms-displayInlineBlock ms-normalWrap">\r\n\r\n</div>\r\n</h1>\r\n\t\t\t</div>\r\n\t\t\t<div class="ms-tableCell ms-verticalAlignTop">\r\n<div id="DeltaPlaceHolderSearchArea" class="ms-mpSearchBox ms-floatRight">\r\n\r\n</div>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t\t</div>\r\n\t\t</div>\r\n\t\t<div id="contentRow">\r\n<div id="sideNavBox"\r\n\t class="ms-dialogHidden ms-forceWrap ms-noList">\r\n <div id="DeltaPlaceHolderLeftNavBar" class="ms-core-navigation" role="navigation">\r\n\r\n</div>\r\n</div>\r\n<div id="contentBox"\r\n aria-live="polite" aria-relevant="all">\r\n <div id="notificationArea" class="ms-notif-box"></div>\r\n\t<div id="DeltaPageStatusBar">\r\n\r\n</div>\r\n\t<div id="DeltaPlaceHolderMain">\r\n\r\n</div>\r\n</div>\r\n<div id="DeltaFormDigest">\r\n\r\n</div>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t</div>\r\n\t\t</div>\r\n\t\t</div>\r\n\r\n\r\n<script type="text/javascript">\r\n//<![CDATA[\r\n\r\nvar filesExist = true;\r\nif (typeof(initJsLoaded) === \'undefined\') { filesExist = false; }\r\nelse if (typeof(Sys) === \'undefined\') { filesExist = false; }\r\nelse if (typeof(Sys.WebForms) === \'undefined\') { filesExist = false; }\r\nelse if (typeof(startJsLoaded) === \'undefined\') { filesExist = false; }\r\nvar sessionStorageEnabled = window.sessionStorage != null;\r\nif (!filesExist) {\r\n if (!sessionStorageEnabled || window.sessionStorage[\'spFilesExist\'] === \'false\'){\r\n if (\'undefined\' != typeof(g_initUrl) && null != g_initUrl && \'\' != g_initUrl)\r\n {\r\n try\r\n {\r\n if (sessionStorageEnabled) \r\n {\r\n window.sessionStorage[\'spFilesExist\'] = \'true\';\r\n }\r\n }\r\n catch (e) {}\r\n var tempAnchor = document.createElement(\'a\');\r\n tempAnchor.href = g_initUrl;\r\n var redir = tempAnchor.href;\r\n tempAnchor = null;\r\n window.location.href=redir;\r\n }\r\n }else{\r\n try\r\n {\r\n window.sessionStorage[\'spFilesExist\'] = \'false\';\r\n window.location.reload(true);\r\n }\r\n catch (e) {}\r\n }\r\n} else {\r\n if (sessionStorageEnabled)\r\n {\r\n window.sessionStorage[\'spFilesExist\'] = \'true\';\r\n }\r\n}\r\nvar workingOnIt = \'Working on it...\';var _spFullDownloadList = [\'closeconnection\', \'download\', \'signout\', \'xlviewer\', \'wordviewer\', \'wordeditor\', \'powerpoint\', \'powerpointframe\', \'onenote\', \'visiowebaccess\', \'storefront\', \'wopiframe\', \'appredirect\', \'wfstart\'];\nif (\'undefined\' != typeof(AsyncDeltaManager$onError)) window.onerror = AsyncDeltaManager$onError;\nvar _fV4UI = true;var origMP = \'|SITES|SANDBOX:|SITES|SANDBOX|_CATALOGS|MASTERPAGE|SEATTLE.MASTER:2.15.0.0.0.15.0.5131.1000.0.FALSE.:en-US:en-US:RW\';var phMain = \'DeltaPlaceHolderMain\';var g_AjaxDeltaList = [{id:\'DeltaPlaceHolderAdditionalPageHead\', container:false},{id:\'DeltaSPWebPartManager\', container:true},{id:\'DeltaDelegateControls\', container:true},{id:\'DeltaSuiteLinks\', container:true},{id:\'DeltaSuiteBarRight\', container:true},{id:\'DeltaSPRibbon\', container:true},{id:\'DeltaSPNavigation\', container:true},{id:\'DeltaWebPartAdderUpdatePanelContainer\', container:true},{id:\'DeltaSiteLogo\', container:true},{id:\'DeltaBreadcrumbDropdown\', container:true},{id:\'DeltaTopNavigation\', container:true},{id:\'DeltaPlaceHolderPageTitleInTitleArea\', container:true},{id:\'DeltaPlaceHolderPageDescription\', container:true},{id:\'DeltaPlaceHolderSearchArea\', container:true},{id:\'DeltaPlaceHolderLeftNavBar\', container:true},{id:\'DeltaPageStatusBar\', container:true},{id:\'DeltaPlaceHolderMain\', container:true},{id:\'DeltaFormDigest\', container:true},{id:\'DeltaPlaceHolderUtilityContent\', container:true}];\n\r\nfunction submitHook() {{return asyncDeltaManager._onFormSubmit();}}\r\nfunction _startOnSubmitStatement() {{return asyncDeltaManager._doSubmitStatements();}}\r\nfunction WebForm_OnSubmit() {{ return asyncDeltaManager._doSubmitStatements(); }}\r\n\r\nif (typeof(hashSaverUrl) != \'undefined\' && hashSaverUrl && hashSaverUrl != \'\') {\r\n if ( (function(u, d) {\r\n var idxDb = u.indexOf(\'//\');\r\n if (-1 != idxDb) {\r\n var idxDe = u.indexOf(\'/\', idxDb+2);\r\n if (-1 == idxDe) idxDe = u.length;\r\n var D = u.substring(idxDb+2, idxDe);\r\n if (d.toUpperCase() != D.toUpperCase()) return true;\r\n }\r\n return false;\r\n }) (hashSaverUrl, document.location.host)) { hashSaverUrl = \'/\';}\r\n window.location.replace(STSPageUrlValidation(hashSaverUrl));\r\n}\r\nvar g_clientIdDeltaPlaceHolderMain = "DeltaPlaceHolderMain";\r\nvar g_clientIdDeltaPlaceHolderPageTitleInTitleArea = "DeltaPlaceHolderPageTitleInTitleArea";\r\nvar g_clientIdDeltaPlaceHolderUtilityContent = "DeltaPlaceHolderUtilityContent";\r\n//]]>\r\n</script>\r\n</form>\r\n\t<span id="DeltaPlaceHolderUtilityContent"></span>\r\n\t<script type="text/javascript">// <![CDATA[ \n\r\n\r\n\t\tvar g_Workspace = "s4-workspace";\r\n\t// ]]>\r\n</script>\r\n</body>\r\n</html>\r\n'
最佳答案
检查以下步骤。
1.安装请求。
pip install requests
2.安装requests_ntlm。
pip install requests_ntlm
3.确保用户名(域名\用户名)和密码正确,然后运行如下代码。
import requests
from requests_ntlm import HttpNtlmAuth
headers = {'accept': 'application/json;odata=verbose'}
r = requests.get("http://sp2013/sites/team/_api/web", auth=HttpNtlmAuth('domain\\admin', 'password'), headers=headers)
print(r.json()["d"]["CustomMasterUrl"])
关于python - 如何修复在 Python 中使用 REST 连接到 SharePoint 并读取数据时的 JSON 解码器问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57877549/
我在网上搜索但没有找到任何合适的文章解释如何使用 javascript 使用 WCF 服务,尤其是 WebScriptEndpoint。 任何人都可以对此给出任何指导吗? 谢谢 最佳答案 这是一篇关于
我正在编写一个将运行 Linux 命令的 C 程序,例如: cat/etc/passwd | grep 列表 |剪切-c 1-5 我没有任何结果 *这里 parent 等待第一个 child (chi
所以我正在尝试处理文件上传,然后将该文件作为二进制文件存储到数据库中。在我存储它之后,我尝试在给定的 URL 上提供文件。我似乎找不到适合这里的方法。我需要使用数据库,因为我使用 Google 应用引
我正在尝试制作一个宏,将下面的公式添加到单元格中,然后将其拖到整个列中并在 H 列中复制相同的公式 我想在 F 和 H 列中输入公式的数据 Range("F1").formula = "=IF(ISE
问题类似于this one ,但我想使用 OperatorPrecedenceParser 解析带有函数应用程序的表达式在 FParsec . 这是我的 AST: type Expression =
我想通过使用 sequelize 和 node.js 将这个查询更改为代码取决于在哪里 select COUNT(gender) as genderCount from customers where
我正在使用GNU bash,版本5.0.3(1)-发行版(x86_64-pc-linux-gnu),我想知道为什么简单的赋值语句会出现语法错误: #/bin/bash var1=/tmp
这里,为什么我的代码在 IE 中不起作用。我的代码适用于所有浏览器。没有问题。但是当我在 IE 上运行我的项目时,它发现错误。 而且我的 jquery 类和 insertadjacentHTMl 也不
我正在尝试更改标签的innerHTML。我无权访问该表单,因此无法编辑 HTML。标签具有的唯一标识符是“for”属性。 这是输入和标签的结构:
我有一个页面,我可以在其中返回用户帖子,可以使用一些 jquery 代码对这些帖子进行即时评论,在发布新评论后,我在帖子下插入新评论以及删除 按钮。问题是 Delete 按钮在新插入的元素上不起作用,
我有一个大约有 20 列的“管道分隔”文件。我只想使用 sha1sum 散列第一列,它是一个数字,如帐号,并按原样返回其余列。 使用 awk 或 sed 执行此操作的最佳方法是什么? Accounti
我需要将以下内容插入到我的表中...我的用户表有五列 id、用户名、密码、名称、条目。 (我还没有提交任何东西到条目中,我稍后会使用 php 来做)但由于某种原因我不断收到这个错误:#1054 - U
所以我试图有一个输入字段,我可以在其中输入任何字符,但然后将输入的值小写,删除任何非字母数字字符,留下“。”而不是空格。 例如,如果我输入: 地球的 70% 是水,-!*#$^^ & 30% 土地 输
我正在尝试做一些我认为非常简单的事情,但出于某种原因我没有得到想要的结果?我是 javascript 的新手,但对 java 有经验,所以我相信我没有使用某种正确的规则。 这是一个获取输入值、检查选择
我想使用 angularjs 从 mysql 数据库加载数据。 这就是应用程序的工作原理;用户登录,他们的用户名存储在 cookie 中。该用户名显示在主页上 我想获取这个值并通过 angularjs
我正在使用 autoLayout,我想在 UITableViewCell 上放置一个 UIlabel,它应该始终位于单元格的右侧和右侧的中心。 这就是我想要实现的目标 所以在这里你可以看到我正在谈论的
我需要与 MySql 等效的 elasticsearch 查询。我的 sql 查询: SELECT DISTINCT t.product_id AS id FROM tbl_sup_price t
我正在实现代码以使用 JSON。 func setup() { if let flickrURL = NSURL(string: "https://api.flickr.com/
我尝试使用for循环声明变量,然后测试cols和rols是否相同。如果是,它将运行递归函数。但是,我在 javascript 中执行 do 时遇到问题。有人可以帮忙吗? 现在,在比较 col.1 和
我举了一个我正在处理的问题的简短示例。 HTML代码: 1 2 3 CSS 代码: .BB a:hover{ color: #000; } .BB > li:after {
我是一名优秀的程序员,十分优秀!