O'Reilly logo

Go Web Development Cookbook by Arpit Aggarwal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How it works…

Once the command has executed successfully, the web application will run on the default Beego port 8080.

Next, we will execute a couple of commands to see how the session works. Firstly, we will access /home by executing the following command: 

$ curl -X GET http://localhost:8080/home 

This will give us an unauthorized access message as a response from the server:

You are unauthorized to view the page.

Apparently, we can't access it because we have to login into the application first, which will create a beegosessionID. Now let's log in to the application by executing the following command: 

$ curl -X GET -i http://localhost:8080/login

This will result in the following response from the server:

Now we will use the cookie

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required