Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

增强ToForm函数 #26

Closed
guonaihong opened this issue Aug 22, 2019 · 0 comments
Closed

增强ToForm函数 #26

guonaihong opened this issue Aug 22, 2019 · 0 comments

Comments

@guonaihong
Copy link
Owner

guonaihong commented Aug 22, 2019

目标:支持gout.H写法
why:这样就不需要定义结构体,可以提升开发效率

伪代码如下

package main

import (
    "fmt"
    "github.com/guonaihong/gout"
)

func main() {

    code := 0
    err := gout.New(nil).
        POST(":8080/test").
        ToForm(gout.H{"mode": "A",
            "text":   "good",
            "voice":  gout.FileFile("test.pcm"),
            "voice2": gout.FileMem("pcm")}).Code(&code).Do()

    if err != nil {
        fmt.Printf("%s\n", err)
    }   

    if code != 200 {
    }   
}
guonaihong added a commit that referenced this issue Aug 22, 2019
guonaihong added a commit that referenced this issue Aug 23, 2019
This was referenced Aug 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant