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

c *gin.Context get parameter #1439

Closed
qianqianyeye opened this issue Jul 21, 2018 · 2 comments
Closed

c *gin.Context get parameter #1439

qianqianyeye opened this issue Jul 21, 2018 · 2 comments

Comments

@qianqianyeye
Copy link

qianqianyeye commented Jul 21, 2018

If I write this,c is *gin.Context

buf := make([]byte, 1024)                                                                                                      
id := c.PostForm("id")
fmt.Println(id)
n, _ := c.Request.Body.Read(buf)
var str string = string(buf[0:n])

I can get it id value,But I can't get str value

If I write this,

buf := make([]byte, 1024)

n, _ := c.Request.Body.Read(buf)

var str string = string(buf[0:n])

I can get str value

Now,I think get the value of the two variables at the same time,How should I write?

c.PostForm does not get c.Request.Body.Read after execution,Vice versa

@thinkerou
Copy link
Member

thinkerou commented Jul 26, 2018

maybe you see #1341 which can help you, if still have problem please reopen the issue and post the whole mini sample code which easy to reproduce it, closing, thanks!

@thinkerou
Copy link
Member

duplicated #1295

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants