Connecting to Neoroute with HTTP

No matter what client SDK you use, this guide will teach you how to connect to your server using a HTTP transporter.

Creating the client

Before opening the actual connection, you need to create a Client (this is the object you’ll be using to send requests).

This is an abstraction we put over the actual connection since you could also be connecting to the server over WebSocket. The actual message you send is the same between WebSocket and HTTP.

Important things

  • Neoroute does not care about which request method you use, but we recommend using POST since it’s the method that describes this usage of HTTP the best. We send your request, encoded in MessagePack, in the request body and the response from the server lives in the response body to the request. It’s also the default for HTTP transporters in neodebug.

Sending requests

Depending on what SDK you use, you can now send requests to your server using HTTP. Follow this guide to learn how.