Building Web Applications With Go (Part 4)

in #steemstem8 years ago

What Will You Learn?

  • How to create an Upload Handler with Go
  • How to create a Handler that takes in multiple HTTP methods
  • How to build a multi-part form in HTML and use it in Go

Requirements

  • An understanding of HTTP GET and POST HTTP methods
  • A small understanding of Multi-part forms
  • Code from Parts 1 and 2
  • Go 1.6+ installed on your machine with the GOPATH and GOROOT setup properly

Difficulty

  • Basic

Description

In this tutorial, we build out an Upload handler for our Go Web application. This upload handler allows a user to post any kind of file to the server where it gets stored in a folder on the localhost. The file is then reserved back to the user. We make use of a multi-part form which allows the user to upload larger files in an asynchronous way. We also build out our handler to handle both the GET and POST request methods on the same route by using a switch statement. We also look at how we can throw HTTP errors with Go as well as how we can build our multi-part form using the go template engine.

The source code for this project can be found here

Video Tutorial

Curriculum

Sort:  

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[moderator]

This is not a contribution to Utopian my man... Not sure why you are moderating it.

Just for fun Ehehehe, missed it i guess^^

Not a problem (got a good chuckle out of it anyways).

This wouldn't pass the Utopian rules anyhow, video is too old.

Thank you for the contribution. It has been approved.

yeah.png

You can contact us on Discord.
[moderator]

Coin Marketplace

STEEM 0.04
TRX 0.32
JST 0.083
BTC 60578.05
ETH 1558.21
USDT 1.00
SBD 0.50