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.