English 中文(简体)
NsurlerrorDomain 代码=-1000 “坏的 URL ” : 它到底是什么意思?
原标题:NSURLErrorDomain Code=-1000 "bad URL": What does it really mean?

我有一个令人困惑的错误。 我正通过 Get 方法发送 JSON, 一个网站会分析并显示数据。 问题在于我正在获取错误“ NSURLERRRRMURDOMAN 代码 - 1000 ” 或更简单的“ Bad URL ” 。 问题是当我检查服务器时, 我发送的数据已经成功解析并显示 。 所以我真的不明白为什么我得到了这个错误“ 错误 URL ” 。 有人能帮助我吗?

以下是我接收的错误:

错误域= NSURLErrorDomain 代码=-1000 “坏 URL” 用户Info= 0xff73df0 {NS undertinError= 0xff73810 “坏 URL”, NS 本地化描述=坏 URL}

编辑:

http://sample.com/imwebjson.php?sid=5amp13&job=sendNotes&im_flds={"im_uid":"1","im_bookid":"57","im_pagenr":"1","im_notes":"Testing%5C%5Cn"}

OK 您可以询问为什么 JSON 字符串的某些部分已经编码。 这些编码部分是特殊字符 。 我意识到字符串“ 添加” PercentEscapeUsing Encoding 十分不完整。 它没有将所有特殊字符编码, 而且当它编码某些特殊字符时, URL 完全不被识别 。 所以我决定手动将特殊字符编码到字符串中 。

最佳回答

冒号字符 < code> : (至少, 可能还有其他诸如 ) 需要将% 编码在 URL 中 。

问题回答

在 GEG 参数中, 您必须更改 “% 20” 的空格“ ”





相关问题
How to change out-of-focus text selection color in Xcode?

Okay, I ll bite. I ve got really pleasant code/window colors set up in Xcode. Ordinarily, my selection color is very visible. When I am doing a project search and iterating through the results, ...

Iphone NSTimer Issue

Hi I am new to objective c. I am trying to make an app for iphone. I have a button on my view, and the click on which the function playSound is called. This is working properly. It does plays the ...

Include a .txt file in a .h in C++?

I have a number of places where I need to re-use some template code. Many classes need these items In a .h could I do something like: #include <xxx.txt> and place all of this code in the ....

Iterating over string/strlen with umlauted characters

This is a follow-up to my previous question . I succeeded in implementing the algorithm for checking umlauted characters. The next problem comes from iterating over all characters in a string. I do ...

Xcode open two editor windows with same file

Is it possible to open the same file in two separate windows in Xcode. I can open a file in one window and the same file in the main Xcode editor window, but I wanted two separate fulltime editor ...

Forcing code signing refresh in Xcode

In our environment, we share resources across multiple projects and platforms. When building for iPhone, only a subset of those resources are needed. Since that subset is still considerable, we have ...