- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我试图通过 Apache REST 客户端从 java 发送 GET 请求并遇到了这个问题。
java.net.URISyntaxException: Illegal character in path at index 75: http://torrento.sharepoint.com/_api/web/getfolderbyserverrelativeurl('/Shared Documents/test')/files at java.net.URI$Parser.fail(URI.java:2848) at java.net.URI$Parser.checkChars(URI.java:3021) at java.net.URI$Parser.parseHierarchical(URI.java:3105) at java.net.URI$Parser.parse(URI.java:3053) at java.net.URI.(URI.java:588) at org.apache.http.client.utils.URIBuilder.(URIBuilder.java:82) at com.mstack.samples.sharepoint.SharepointApp.getAllFiles(SharepointApp.java:61) at com.mstack.samples.sharepoint.SharepointApp.main(SharepointApp.java:45)
代码片段:-
httpClient = HttpClientBuilder.create().build();
uriBuilder = new URIBuilder(requestUrl);
System.out.println(uriBuilder);
httpGet = new HttpGet(uriBuilder.build());
httpGet.addHeader(AUTHORIZATION, "Bearer " + TOKEN);
httpGet.addHeader("accept", "application/json; odata=verbose");
response = httpClient.execute(httpGet);
其中 requestUrl 是 http://torrento.sharepoint.com/_api/web/getfolderbyserverrelativeurl('/Shared Documents/test')/files
我知道 Shared 和 Documents 之间的空间是问题所在。试图对其进行编码。但这也没有用。请帮忙
最佳答案
我通过简单地添加 requestUrl.replaceAll("", "%20");
获得了解决方案但如果是其他特殊字符,仅此一项是行不通的。所以我们必须在发送请求之前对url进行编码。
干杯:)
关于java.net.URISyntaxException : Illegal character in path at index 75,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38122995/
#include #include using namespace std; //void multiply(int b); int main() { float total = 0; flo
我正在尝试加载存储在 HDFS 中的 Hadoop 集群上的 informatica 日志文件。我在 Python 中使用 subprocess 来执行此操作,但相信由于文件名而出现错误,我不确定如何
我尝试制作用于 Symfony 2 上传的 ajax 脚本。Chrome 返回此错误: Uncaught TypeError: Illegal invocation jquery.min.js:4 我
这只是一个简单的代码,用于检查一个数字是否是质数,我不知道这是编译器还是代码的问题。如果您能提供一些帮助,我们将不胜感激。 这是代码: #include "stdio.h" int main() {
当我运行这个 bash 脚本时: if [ [$EUID -ne 0] ]; then echo "This script must be run as root" 1>&2 exit 1
我最近偶然发现了 this jcstress 中的示例: @JCStressTest @State @Outcome(id = "10", expect =
我不理解这个错误(C2100:非法间接)。我标记了三个实例——都在底部附近。我在网上看过,我知道这与我的指示有关,但在 8 小时后,我完全迷路了。这里可能还有其他一些错误,但我什至无法分辨,因为我无法
我们正在运行一个 Create React App (CRA) Web 应用程序,我们已向其中添加了 Google Analytics v4。我们使用 ga-4-react 启动分析npm 包。 in
我想将多个图像对象发布到 testphp.php。但控制台打印错误说非法调用。 我已经尝试过: submit $("#sub").click(function(){ // get th
当文本框为空时尝试禁用按钮时,我在 google chrome 控制台中收到此错误: function isEmpty() { var r = document.getElementById;
我只是在玩 timesheet.js的源代码(参见具体行)并遇到一个小错误,请参见下面的代码行: '', 当我生成 HTML 并将其分成两行时,一切正常,但如果我执行以下操作将
public class Flatten { public static int[] flatten(int[][] x) { int totalLength = 0;
我的计算机上有一个 python3 脚本,我可以使用 python3motion_detection.py 运行它,并且该脚本有效,我尝试在我的 Raspberry 上使用它,但失败并显示消息非法指令
我正在尝试最近学到的一些多线程概念,但无法运行它。 它给出了 IllegalMonitorStateException 但没有弄清楚错误发生的原因。 因此,关于代码2线程引用名称填充器和写入器都共享一
这是 html 这是脚本 $('#submit').click(function() { var files = $("[type='file']")[0].fil
我尝试通过ajax提交表单,下面是表单。 Date Upload File
我几天前买了 C++ Primer 这本书,我开始学习这门新语言了! 此刻,我想弄明白为什么我自己写的这个 block 是非法的: 我将一个 const int 初始化为 512;我初始化一个指向 n
我收到以下错误消息 [Err] 1267 - Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,C
我正在尝试使用本教程创建一个 PostgreSQL 数据库: http://tutorials.jumpstartlab.com/topics/environment/environment.html
我想弄乱 Speech Recognition API,所以我从简单的页面开始,该页面在单击 body 元素时开始识别。我的 scripts.js 文件是: var recognition = new
我是一名优秀的程序员,十分优秀!