{"action":"created","issue":{"url":"https://api.github.com/repos/gavv/httpexpect/issues/8","repository_url":"https://api.github.com/repos/gavv/httpexpect","labels_url":"https://api.github.com/repos/gavv/httpexpect/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/gavv/httpexpect/issues/8/comments","events_url":"https://api.github.com/repos/gavv/httpexpect/issues/8/events","html_url":"https://github.com/gavv/httpexpect/issues/8","id":162389512,"number":8,"title":"Can't read form value with iris(fasthttp)","user":{"login":"gosilent","id":19830249,"avatar_url":"https://avatars.githubusercontent.com/u/19830249?v=3","gravatar_id":"","url":"https://api.github.com/users/gosilent","html_url":"https://github.com/gosilent","followers_url":"https://api.github.com/users/gosilent/followers","following_url":"https://api.github.com/users/gosilent/following{/other_user}","gists_url":"https://api.github.com/users/gosilent/gists{/gist_id}","starred_url":"https://api.github.com/users/gosilent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gosilent/subscriptions","organizations_url":"https://api.github.com/users/gosilent/orgs","repos_url":"https://api.github.com/users/gosilent/repos","events_url":"https://api.github.com/users/gosilent/events{/privacy}","received_events_url":"https://api.github.com/users/gosilent/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-06-27T07:29:02Z","updated_at":"2016-06-27T08:37:53Z","closed_at":null,"body":"I edit iris test code from your example:\r\n\r\niris.go\r\n```go\r\nfunc IrisHandler() fasthttp.RequestHandler {\r\n\tiris.Post(\"/hello\", func(ctx *iris.Context) {\r\n\t\tctx.SetStatusCode(iris.StatusOK)\r\n\t\tctx.SetContentType(\"application/x-www-form-urlencoded\")\r\n\r\n\t\tctx.SetBodyString(string(ctx.FormValue(\"Test\")))\r\n\t})\r\n\r\n\treturn iris.NoListen().Handler\r\n}\r\n```\r\n\r\niris_test.go\r\n```go\r\nfunc TestIris(t *testing.T) {\r\n\t// create fasthttp.RequestHandler\r\n\thandler := IrisHandler()\r\n\r\n\t// create httpexpect instance that will call fasthtpp.RequestHandler directly\r\n\te := httpexpect.WithConfig(httpexpect.Config{\r\n\t\tReporter: httpexpect.NewAssertReporter(t),\r\n\t\tClient:   httpexpect.NewFastBinder(handler),\r\n\t})\r\n\r\n\t// run tests\r\n\tee := e.POST(\"/hello\").WithFormField(\"Test\", \"TESTDATA\").Expect()\r\n\tee.Status(http.StatusOK)\r\n\tee.Form().ContainsKey(\"Test\")\r\n\tee.Form().ValueEqual(\"Test\", \"TESTDATA\")\r\n}\r\n```\r\n\r\nand I got the error\r\n\r\n```\r\n--- FAIL: TestIris (0.00s)\r\n        Error Trace:    reporter.go:22\r\n\t\t\tchain.go:21\r\n\t\t\tobject.go:152\r\n\t\t\tiris_test.go:24\r\n\tError:\r\n\t\t\texpected object containing key 'Test', but got:\r\n\t\t\t {}\r\n\r\n        Error Trace:    reporter.go:22\r\n\t\t\tchain.go:21\r\n\t\t\tobject.go:236\r\n\t\t\tiris_test.go:25\r\n\tError:\r\n\t\t\texpected object containing key 'Test', but got:\r\n\t\t\t {}\r\n\r\nFAIL\r\nexit status 1\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/gavv/httpexpect/issues/comments/228685557","html_url":"https://github.com/gavv/httpexpect/issues/8#issuecomment-228685557","issue_url":"https://api.github.com/repos/gavv/httpexpect/issues/8","id":228685557,"user":{"login":"kataras","id":2321588,"avatar_url":"https://avatars.githubusercontent.com/u/2321588?v=3","gravatar_id":"","url":"https://api.github.com/users/kataras","html_url":"https://github.com/kataras","followers_url":"https://api.github.com/users/kataras/followers","following_url":"https://api.github.com/users/kataras/following{/other_user}","gists_url":"https://api.github.com/users/kataras/gists{/gist_id}","starred_url":"https://api.github.com/users/kataras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kataras/subscriptions","organizations_url":"https://api.github.com/users/kataras/orgs","repos_url":"https://api.github.com/users/kataras/repos","events_url":"https://api.github.com/users/kataras/events{/privacy}","received_events_url":"https://api.github.com/users/kataras/received_events","type":"User","site_admin":false},"created_at":"2016-06-27T08:37:53Z","updated_at":"2016-06-27T08:37:53Z","body":"Hello @gosilent could you try changing the \r\n```go\r\nctx.SetStatusCode(iris.StatusOK) // this can be removed\r\nctx.SetBodyString(string(ctx.FormValue(\"Test\"))) // this will change to ctx.ReadForm\r\n```\r\n\r\nto:\r\n\r\n```go\r\nt := struct {\r\n\tTest string\r\n}{}\r\nctx.ReadForm(&t)\r\nctx.Write(t.Test)\r\n```\r\n\r\nand confirm that works?"}}
{"actor":{"display_login":"kataras"}}