O'Reilly logo

Haskell Cookbook by Yogesh Sajanikar

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...

In this recipe, we explained how we can do routing. A URL (for example, http://example.com:8080/some/path?param) has these two main parts: 

  • The first part locates the server and service, and is composed of a scheme (such as HTTP/HTTPS), a host name (example.com), and a port. 
  • The second part is composed of a path or routes, and query parameters. (/some/path?param).

The generic schema is explained at https://en.wikipedia.org/wiki/URL.

In a web application, we are interested in the HTTP/HTTPS schema and path. Each path can be connected by a remote user through a verb such as GET, POST, PUT, or DELETE. Combined with HTTP verbs and paths, the web application delivers web content. 

In this recipe, we worked with GET requests ...

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