Questions tagged «http-put»


6
我应该在REST API中使用PATCH还是PUT?
我想使用适合以下情况的方法设计其余端点。 有一个小组。每个组都有一个状态。该组可以由管理员激活或停用。 我应该将终点设计为 PUT /groups/api/v1/groups/{group id}/status/activate 要么 PATCH /groups/api/v1/groups/{group id} with request body like {action:activate|deactivate}

3
Elasticsearch不支持Content-Type标头[application / x-www-form-urlencoded]
我曾经有ElasticSearch 5.2,并且刚升级到6.0。 我正在尝试按照此处的指南创建索引模板,但出现错误 Content-Type header [application/x-www-form-urlencoded] is not supported 我的查询是 curl -X PUT localhost:9200/_template/template_1 -d ' { "index_patterns": ["te*", "bar*"], "mappings": { "type1": { "properties": { "host_name": { "type": "keyword" } } } } }'

4
PHP cURL HTTP PUT
我正在尝试使用cURL创建一个HTTP PUT请求,但无法使其正常工作。我已经阅读了许多教程,但没有一个真正起作用。这是我当前的代码: $filedata = array('metadata' => $rdfxml); $ch = curl_init($url); $header = "Content-Type: multipart/form-data; boundary='123456f'"; curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, array($header)); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($filedata)); $returned = curl_exec($ch); if (curl_error($ch)) { print curl_error($ch); } else { print 'ret: ' .$returned; } 我也尝试使用PHP …
75 php  rest  curl  put  http-put 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.