APIs & HTTP

Real-time APIs and contracts

WebSocket, SSE, GraphQL, OpenAPI and project web preview.

In this guideChoose the service protocolFrom a contract to a testIf the connection does not start

Choose the service protocol#

WebSocket and SSE have dedicated tools. Prepare the URL, authentication and context, connect, then disconnect when finished. GraphQL offers schema exploration and completion where the service permits schema access. An ordinary HTTP response is not a WebSocket session.

  1. Check the protocol and URL: HTTP/HTTPS for SSE and APIs, WS/WSS for WebSocket.
  2. Configure required credentials without copying them into public files.
  3. Start explicitly and read events, messages or errors; cancel before switching services.
HTTP client: requests and responses beside the project.Code Weaver · Windows beta

From a contract to a test#

API tools support OpenAPI 3.x import, a local mock server, response validation and contract-version comparisons. A mock server helps exercise a contract; it does not prove that the real service behaves identically.

For mTLS, configure client certificates and an HTTPS profile appropriate to the endpoint. Web preview uses a local development server and can forward WebSocket/HMR. The process must already be running and HMR availability depends on the project.

If the connection does not start#

First check that the service is listening on the chosen port, the protocol is correct and the certificate is valid. Use the port monitor or terminal to distinguish a stopped server from an authentication or contract error.

Open original image ↗