cyga / www_fdw

fdw extension for postgres
http://wiki.postgresql.org/wiki/WWW_FDW
123 stars 21 forks source link

Implementing DELETE in method_select #25

Closed KrzysztofCzajkaTURCOM closed 7 years ago

KrzysztofCzajkaTURCOM commented 8 years ago
@@ -1807,6 +1807,11 @@ www_begin(ForeignScanState *node, int eflags)
         {
             curl_easy_setopt(curl, CURLOPT_HTTPHEADER, curl_opts);
         }
+        
+        /* Deleting */
+        if ( 0 == strcmp(opts->method_select, "DELETE")) {
+            curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE" );
+        }

    /* prepare parsers */
    if( 0 == strcmp(opts->response_type, "json") )