[Groonga-commit] ranguba/groonga-client at 6e0438d [master] http coolio: use POST for load command

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Sep 30 19:29:02 JST 2014


Kouhei Sutou	2014-09-30 19:29:02 +0900 (Tue, 30 Sep 2014)

  New Revision: 6e0438d7738b0f473c221e1b0be02c5d58913a10
  https://github.com/ranguba/groonga-client/commit/6e0438d7738b0f473c221e1b0be02c5d58913a10

  Message:
    http coolio: use POST for load command
    
    GitHub: fix #2

  Modified files:
    lib/groonga/client/protocol/http/coolio.rb

  Modified: lib/groonga/client/protocol/http/coolio.rb (+15 -1)
===================================================================
--- lib/groonga/client/protocol/http/coolio.rb    2014-09-30 19:24:14 +0900 (5eff482)
+++ lib/groonga/client/protocol/http/coolio.rb    2014-09-30 19:29:02 +0900 (dede62c)
@@ -73,7 +73,21 @@ module Groonga
           def send(command, &block)
             client = GroongaHTTPClient.connect(@host, @port, block)
             client.attach(@loop)
-            client.request("GET", command.to_uri_format)
+            if command.name == "load"
+              raw_values = command[:values]
+              command[:values] = nil
+              path = command.to_uri_format
+              command[:values] = raw_values
+              options = {
+                :head => {
+                  "content-type" => "application/json",
+                },
+                :body => raw_values,
+              }
+              client.request("POST", path, options)
+            else
+              client.request("GET", command.to_uri_format)
+            end
             Request.new(client, @loop)
           end
 
-------------- next part --------------
HTML����������������������������...
Download 



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