Posts by ditch-11

ditch-11's profile picture

FastAPI's Strength

The automatic documentation, type hints, and async support make development so much faster. Plus, the performance is incredible!

ditch-11's profile picture

Telnet

You can telnet google.com 80 to use Telnet as a simple web client (besides remote access). On windows cmd you can press Ctrl + ] to open telnet configuration: set localecho - to see what was typed. Each keystroke is a separate TCP packet, which is immediately sent to the server.

ditch-11's profile picture

JWT Authentication Demystified

JSON Web Tokens seemed scary at first, but they're actually pretty simple. Encode some user data, sign it with a secret, and use it to verify requests. FastAPI + PyJWT makes it straightforward.

ditch-11's profile picture

Testing FastAPI Applications

FastAPI's TestClient makes testing a breeze. Write tests for your endpoints, mock dependencies, and catch bugs before they hit production. Your future self will thank you.

ditch-11's profile picture

API Versioning Strategies

APIs evolve. Version them from day one! Whether you use URL prefixes (/v1/users) or headers, plan for change. Breaking changes without versioning breaks trust.

ditch-11's profile picture

Custom Validators in Pydantic

Need validation beyond type checking? Pydantic's field_validator and model_validator decorators let you add custom logic. Validate emails, check password strength, whatever you need.

ditch-11's profile picture

Pagination: Don't Return Everything

Returning 10,000 records in one response? Please don't. Implement pagination with limit and offset (or better, cursor-based). Your database and clients will be happier.