Giter Club home page Giter Club logo

Comments (9)

Dexus avatar Dexus commented on August 22, 2024

from siris.

everton-sales-branco avatar everton-sales-branco commented on August 22, 2024

@Dexus Is there any function to it?

from siris.

Dexus avatar Dexus commented on August 22, 2024

from siris.

Allendar avatar Allendar commented on August 22, 2024

I never used it, but I think it was something like this:

type FormObject struct {
	Username string `form:"username"`
	Password string `form:"password"`
}

func yourRouteFunction(c context.Context) {
	form := &FormObject{}
	c.ReadForm(form)
}

from siris.

Dexus avatar Dexus commented on August 22, 2024

Try this: google/go-querystring#7 (comment)

It's not yet for GET Params (Querystring) implemented if looked just into it. But we can do it.

from siris.

Dexus avatar Dexus commented on August 22, 2024

Or even better maybe: https://github.com/pasztorpisti/qs

from siris.

Dexus avatar Dexus commented on August 22, 2024

When you use ctx.Request.URL.Query() and qs or schema you don't need to build this crap wrapper...

from siris.

everton-sales-branco avatar everton-sales-branco commented on August 22, 2024

Ok, qs is the solution.

from siris.

Dexus avatar Dexus commented on August 22, 2024

Internal notice:

Add a new context function for get params to parse into a struct. Also add a shortcut function to get fields only for querystrings, because ctx.request.Form (ctx.FormValue('namestring') or ctx.FormValues()) overwrite same name fields with post/put params.

from siris.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.