标签: post

什么REST PUT/POST/DELETE调用应按约定返回?

  1. 根据"REST意识形态",PUT/POST/DELETE请求的响应主体应该是什么?

  2. 返回代码怎么样?是否HTTP_OK足够?

  3. 如果有的话,这些公约的原因是什么?

我发现了一篇描述POST/PUT差异的好帖子:POST vs PUT 但它仍然没有回答我的问题.

rest post http http-delete

150
推荐指数
2
解决办法
11万
查看次数

表单上的Javascript帖子提交打开一个新窗口

/sf/ask/9374781/向您展示如何通过邮件提交您通过JavaScript创建的表单.以下是我修改过的代码.

var form = document.createElement("form");

form.setAttribute("method", "post");
form.setAttribute("action", "test.jsp");

var hiddenField = document.createElement("input");  

hiddenField.setAttribute("name", "id");
hiddenField.setAttribute("value", "bob");
form.appendChild(hiddenField);
document.body.appendChild(form); // Not entirely sure if this is necessary          
form.submit();
Run Code Online (Sandbox Code Playgroud)

我想做的是在新窗口中打开结果.我当前正在使用这样的东西在新窗口中打开一个页面:

onclick = window.open(test.html, '', 'scrollbars=no,menubar=no,height=600,width=800,resizable=yes,toolbar=no,status=no');
Run Code Online (Sandbox Code Playgroud)

html javascript post

149
推荐指数
3
解决办法
27万
查看次数

在没有实体主体的情况下执行HTTP POST被认为是不好的做法吗?

我需要调用一个不需要用户输入的进程,只需要一个触发器.我计划在没有正文的情况下使用POST/uri来触发进程.我想知道从HTTP和REST角度来看这是否被认为是坏的?

rest post http

149
推荐指数
4
解决办法
6万
查看次数

是否可以在HTTP中缓存POST方法?

使用非常简单的缓存语义:如果参数相同(当然URL相同),那么它就是一个命中.那可能吗?推荐的?

post http http-caching

146
推荐指数
6
解决办法
8万
查看次数

如何修复java.net.SocketException:管道坏了?

我正在使用apache commons http客户端使用post方法调用url来发布参数,并且它很少抛出以下错误.

java.net.SocketException: Broken pipe
        at java.net.SocketOutputStream.socketWrite0(Native Method)
        at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
        at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
        at java.io.BufferedOutputStream.write(BufferedOutputStream.java:105)
        at java.io.FilterOutputStream.write(FilterOutputStream.java:80)
        at org.apache.commons.httpclient.methods.ByteArrayRequestEntity.writeRequest(ByteArrayRequestEntity.java:90)
        at org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:499)
        at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2114)
        at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1096)
        at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
Run Code Online (Sandbox Code Playgroud)

有人可以建议导致此异常的原因以及如何调试它吗?

java sockets post exception

144
推荐指数
4
解决办法
44万
查看次数

如何使用HTTP POST选择并使用HTML和PHP上传多个文件?

我有使用单文件上传的经验<input type="file">.但是,我无法一次上传多个.

例如,我希望能够一次性选择一系列图像,然后将它们上传到服务器.

如果可能的话,使用单个文件输入控件会很棒.

有谁知道如何做到这一点?谢谢!

html php upload post http

143
推荐指数
6
解决办法
29万
查看次数

使用curl POST多部分/表单数据的正确方法是什么?

我使用这种语法发布文件以及一些参数:

curl -v -include --form "key1=value1" --form upload=localfilename URL
Run Code Online (Sandbox Code Playgroud)

该文件大小约为500K.首先,我看到发送端的内容长度为254.之后服务器响应的内容长度为0.我哪里错了?

这是命令的完整跟踪.

* Couldn't find host xxx.xxx.xxx.xxx in the _netrc file; using defaults
* About to connect() to xxx.xxx.xxx.xxx port yyyy (#0)
*   Trying xxx.xxx.xxx.xxx...
* Adding handle: conn: 0x4b96a0
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x4b96a0) send_pipe: 1, recv_pipe: 0
* Connected to xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx) port yyyy (#0)
* POST /zzzzzz/UploadFile HTTP/1.1
* User-Agent: curl/7.32.0
* Host: xxx.xxx.xxx.xxx:yyyy …
Run Code Online (Sandbox Code Playgroud)

forms post curl

139
推荐指数
3
解决办法
15万
查看次数

如何使用POSTMAN同时发出多个请求

我想从POSTMAN Google Chrome扩展程序中发布数据.我想用不同的数据发出10个请求,它应该是同一时间.

在POSTMAN中可以这样做吗?如果有,任何人都可以解释我如何实现这一目标?

感谢您的时间.

post http-request postman

139
推荐指数
9
解决办法
16万
查看次数

如何获得WordPress发布精选图片网址

我正在使用此功能来获取精选图像

<a href="#" rel="prettyPhoto">
    <?php the_post_thumbnail('thumbnail'); ?>
</a>
Run Code Online (Sandbox Code Playgroud)

现在我想获得点击锚标签的全功能图像,我需要一个特色图像网址

<a href="here" rel="prettyPhoto">
Run Code Online (Sandbox Code Playgroud)

请帮忙

php wordpress post

137
推荐指数
10
解决办法
34万
查看次数

如何在Python中处理POST和GET变量?

在PHP中,您可以使用$_POSTPOST和$_GETGET(查询字符串)变量.什么是Python中的等价物?

python post get

134
推荐指数
4
解决办法
17万
查看次数