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

Missing values and media type errors #1

Closed
codegangsta opened this issue Feb 8, 2014 · 2 comments
Closed

Missing values and media type errors #1

codegangsta opened this issue Feb 8, 2014 · 2 comments

Comments

@codegangsta
Copy link
Member

from @abh

With the code below I get [martini] PANIC: Value not found for type *main.checkForm if I run curl -XPOST -dqueue=1 http://localhost:1234/check/127.0.0.1 and if I run the same without any form parameters I get a 400 bad request response and this JSON in the response {"overall":{"DeserializationError":"mime: no media type"},"fields":{}}.

Neither is what I expected. I was using roughly the same code with the now removed form middleware.

type checkForm struct {
    Queue string `form:"queue"`
}

func runWeb() {
    m := martini.Classic()
    m.Use(render.Renderer())

    m.Post("/check/:ip",
        binding.Bind(checkForm{}),
        func(res http.ResponseWriter, params martini.Params, options *checkForm, rndr render.Render) {
                   ....
@codegangsta
Copy link
Member Author

more of the conversation can be found here: https://github.com/codegangsta/martini-contrib/issues/81

@mholt
Copy link
Contributor

mholt commented Mar 25, 2014

As I re-read this issue, it seems very similar or probably related to #4, which we squished. I'm going to close it now. If something isn't being covered in the tests, feel free to open another issue or, preferably, submit a PR!

@mholt mholt closed this as completed Mar 25, 2014
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