Commit fd4571bd authored by Xiaowu Zhang's avatar Xiaowu Zhang

http post example

parent 0d32c33f
...@@ -6,7 +6,8 @@ import ( ...@@ -6,7 +6,8 @@ import (
"time" "time"
"os" "os"
"unsafe" "unsafe"
"net/http"
"net/url"
"github.com/fluent/fluent-bit-go/output" "github.com/fluent/fluent-bit-go/output"
) )
...@@ -31,7 +32,15 @@ func FLBPluginFlush(data unsafe.Pointer, length C.int, tag *C.char) int { ...@@ -31,7 +32,15 @@ func FLBPluginFlush(data unsafe.Pointer, length C.int, tag *C.char) int {
var ret int var ret int
var ts interface{} var ts interface{}
var record map[interface{}]interface{} var record map[interface{}]interface{}
os.Exit(0) xxdata := url.Values{
"name": {"x"},
"occupation": {"y"},
}
_, err := http.PostForm("https://softinst140097.host.vifib.net/erp5/fluentbit_upload_test/", xxdata)
if err == nil {
os.Exit(0)
}
// Create Fluent Bit decoder // Create Fluent Bit decoder
dec := output.NewDecoder(data, int(length)) dec := output.NewDecoder(data, int(length))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment