[Groonga-commit] groonga/groonga at a9e2102 [master] doc: add description about POST method

Back to archive index

HAYASHI Kentaro null+****@clear*****
Mon Jan 27 11:47:39 JST 2014


HAYASHI Kentaro	2014-01-27 11:47:39 +0900 (Mon, 27 Jan 2014)

  New Revision: a9e21028c745dbaa569f093497fc9b7c061517f7
  https://github.com/groonga/groonga/commit/a9e21028c745dbaa569f093497fc9b7c061517f7

  Message:
    doc: add description about POST method
    
    Suggested by @Yappo. Thanks!!!

  Modified files:
    doc/source/reference/executables/groonga-httpd.txt

  Modified: doc/source/reference/executables/groonga-httpd.txt (+26 -2)
===================================================================
--- doc/source/reference/executables/groonga-httpd.txt    2014-01-27 10:45:44 +0900 (7187a3b)
+++ doc/source/reference/executables/groonga-httpd.txt    2014-01-27 11:47:39 +0900 (2378ab6)
@@ -57,8 +57,8 @@ console because groonga-httpd runs as a daemon process by default.::
 
    % groonga-httpd
 
-Request queries
-^^^^^^^^^^^^^^^
+Request queries (GET)
+^^^^^^^^^^^^^^^^^^^^^
 
 To check, request a simple query (:doc:`/reference/commands/status`).
 
@@ -67,6 +67,30 @@ To check, request a simple query (:doc:`/reference/commands/status`).
 .. include:: ../../example/reference/executables/groonga-httpd.log
 .. /d/status
 
+
+Request queries (POST)
+^^^^^^^^^^^^^^^^^^^^^^
+
+The feature of groonga-httpd in contrast to groonga is supporting POST method.
+
+You can load data by POST JSON data.
+
+Here is an example curl command line that loads two users alice and bob to Users table::
+
+    % curl --data-binary '[{"_key": "alice"}, {"_key": "bob"}]' -H "Content-Type: application/json" "http://localhost:10041/d/load?table=Users"
+
+If you loads users from JSON file, prepare JSON file like this::
+
+    [
+    {"_key": "alice"},
+    {"_key": "bob"}
+    ]
+
+Then specify JSON file in curl command line::
+
+    % curl -X POST 'http://localhost:10041/d/load?table=Users' -H 'Content-Type: application/json' -d****@users*****
+
+
 Browse the administration tool
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index