Thanks for this feedback. To be precise, Am looking at two things 1. Receiving raw post data in Go (like HTML PHP Forms) where I have a file receive.go that can read the post as it comes.
2. Receiving json data Like in PHP Json ( $data = json_decode( file_get_contents('php://input'), true);) The above should be in Golang. Is this more clear? On Monday, August 14, 2017 at 4:43:50 PM UTC+3, Konstantin Khomoutov wrote: > > On Mon, Aug 14, 2017 at 05:06:08AM -0700, Kennedy Kanyi wrote: > > > I would want to inquire how I can receive POST data from a URL using > Golang. > > > > A case study would be where a system sends a username and password via > POST > > and my Go receiving file reads the post and the values. > > In addition to what Shawn said, note that "a system sends" is too vague. > > The problem is that the HTTP POST method basically defines that the > sender streams some data after the HTTP header; the format of this data > is not defined by the method. And hence it's possible to send data in > absolutely any format using HTTP POST. > > In the simplest and oldest form, when a browser "posts" a so-called HTML > form from an HTML document it presented to the user, it formats the data > either using the application/x-www-form-urlencoded format (for simple > forms) or multipart/form-data (when a file upload is used). > > But these days, when the so-called "single page web applications" are a > norm, it's customary to send payloads in POST requests formatted using > more "common" approaches such as JSON. > > So you should clearly figure out for yourself what generates your data > and what format it has. > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.