/go_test

Primary LanguageGo

GOlang test <- testing the response and request

created by Anand Venkataraman

email: anandvenkatarama@gmail.com

Requirements

  • A PC/MAC with go installed
  • Environments set (refer this link https://golang.org/doc/install)
  • Some sort of IDE or code editor to open the go file
  • Internet browser like Chrome, Firefox, Opera, Safari

Instructions

  • Browse to src/ folder
  • Open command/terminal
  • Run the following command: go run requestform.go
  • You should see the "Server Started... with port #" message in terminal
  • Open browser and enter the localhost address shown. It may look like (http://localhost:8080)
  • You will see a form open
  • Enter a name and message
  • It should show you the values entered in the form after you click submit

What does it do

  • This script sends a request of POST while clicking submit
  • Using Victor Springer's cache. This is a high performance Golang HTTP middleware for server-side application layer caching, ideal for REST APIs.
  • Cache span = 30 minutes
  • Shows the output via GET request