我正在使用Eclipse for Java EE开发Web应用程序.我有使用HTML文件构建的JSP文件作为包含.我的index.jsp看起来像这样:
<jsp:include page="include/top.html" />
<title>Title!</title>
<jsp:include page="include/header.html" />
<jsp:include page="include/menu.html" />
<div class="span-15 prepend-1 last">
<h6>What is an <a href="http://en.wikipedia.org/wiki/Application_programming_interface">API</a>?</h6>
<p>An application programming interface (API) is an interface that software programs implement in order to allow other software to interact with it; much in the same way that software might implement a User interface in order to allow humans to interact with it.</p>
</div>
<jsp:include page="include/footer.html" />
Run Code Online (Sandbox Code Playgroud)
问题在于包含.footer.html看起来像这样:
<hr />
<h3 class="alt"><b><a href="/copyright.html">Copyright</a> © 2009</b> …Run Code Online (Sandbox Code Playgroud) 我有一个像:
<table id="message">
<tr class="clsaa1">
<td>
<div class="class3">
<table class="sub_1">
----------------------
----------------------
</table>
<div>
</td>
</tr>
<tr class="clsaa2">
<td>
<div class="class3">
----------------------
----------------------
<div>
</td>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud)
我需要删除 class里面的所有属性#message.
我试过了
$('#message').siblings().removeAttr('class');
Run Code Online (Sandbox Code Playgroud)
和
$('#message').children().removeAttr('class');
Run Code Online (Sandbox Code Playgroud)
但这不起作用.
向Blogger REST API(v3.0)发送DELETE请求,我正在尝试使用delete方法删除帖子.为此,我使用以下代码:
api_uri = 'https://www.googleapis.com/blogger/v3/blogs/%s/posts/%s' % (blogId, postId)
result = urlfetch.fetch(url=api_uri,
method=urlfetch.DELETE,
headers={'Authorization' : oauth_token})
self.response.out.write(result.content)
Run Code Online (Sandbox Code Playgroud)
但服务器返回:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "notFound",
"message": "Not Found"
}
],
"code": 404,
"message": "Not Found"
}
}
Run Code Online (Sandbox Code Playgroud)
但是,我可以使用以下代码检索有关此帖子的信息:
api_uri = 'https://www.googleapis.com/blogger/v3/blogs/%s/posts/%s' % (blogId, postId)
result = urlfetch.fetch(url=api_uri,
headers={'Authorization' : oauth_token})
self.response.out.write(result.content)
Run Code Online (Sandbox Code Playgroud)
此刻,我无法理解我做错了什么 - 请求被授权,blogId并且postId是正确的 - 但无论如何,服务器返回"未找到"错误.
如果您知道如何解决这个问题,或者您可以提供有用的建议 - 请帮助我.
感谢您抽出宝贵的时间和对此事的考虑.
UPD 1:如果我向以下网址发送请求:
# https://www.googleapis.com/blogger/v3/users/{userID}
# https://www.googleapis.com/blogger/v3/users/self
Run Code Online (Sandbox Code Playgroud)
服务器还返回:
{
"error": { …Run Code Online (Sandbox Code Playgroud)