Code Explainers
Code explainers tagged #http-headers
ruby
module Paginatable extend ActiveSupport::Concern private
A reusable pagination concern in Rails
pagination
concerns
http-headers
Intermediate
8 steps
python
from flask import Blueprint, render_template, jsonify, request, abort from .models import Article
Content negotiation in a Flask Blueprint
content-negotiation
http-headers
routing
Intermediate
7 steps
php
<?php namespace App\Http\Support;
Adding RFC 5988 Link headers in Laravel
pagination
http-headers
rest-api
Intermediate
7 steps
rust
use std::net::{IpAddr, SocketAddr}; use axum::extract::{ConnectInfo, FromRequestParts}; use axum::http::request::Parts;
How a custom ClientIp extractor works in Axum
extractor
http-headers
proxy-forwarding
Intermediate
8 steps
go
func (h *ExportHandler) BulkExport(c *gin.Context) { projectID := c.Param("projectID") reports, err := h.reports.ListByProject(c.Request.Context(), projectID)
Streaming a ZIP download in Gin
streaming
zip-archive
http-headers
Intermediate
8 steps
php
<?php namespace App\Http\Controllers;
Server-Sent Events in Laravel
server-sent-events
streaming
long-polling
Advanced
9 steps
rust
use axum::{ extract::FromRequestParts, http::{request::Parts, StatusCode, header::ACCEPT_LANGUAGE}, };
A locale extractor for Axum handlers
content-negotiation
http-headers
custom-extractor
Intermediate
7 steps
rust
use axum::{ extract::{Request, State}, http::{HeaderValue, StatusCode}, middleware::Next,
API version headers with Axum middleware
middleware
http-headers
versioning
Intermediate
8 steps
rust
use axum::{ body::Body, http::{header, HeaderValue, StatusCode, Uri}, response::{IntoResponse, Response},
Serving embedded static files in Axum
static-assets
embedding
http-headers
Intermediate
7 steps
ruby
class Admin::OrdersExportController < Admin::BaseController include ActionController::Live def show
Streaming a CSV export in Rails
streaming
csv-export
batching
Advanced
8 steps
java
@RestController @RequestMapping("/api/reports") public class OrderReportController {
Streaming a CSV export in Spring
streaming
csv-export
backpressure
Intermediate
9 steps
python
import time from flask import Flask, g, request
Timing requests with Flask hooks
middleware
request-lifecycle
instrumentation
Intermediate
5 steps
go
func ProxyDownload(c *gin.Context) { objectKey := c.Param("key") upstream := fmt.Sprintf("%s/files/%s", storageBaseURL, objectKey)
Streaming a proxied download in Gin
reverse-proxy
streaming
http-headers
Intermediate
8 steps
rust
use std::time::Duration; use axum::{ extract::State,
Rate-limit errors as Axum responses
error-handling
rate-limiting
http-headers
Intermediate
6 steps
go
package server import ( "net/http"
Serving cached static assets in Gin
caching
static-files
middleware
Intermediate
7 steps
go
package middleware import ( "net/http"
Building a CORS middleware in Gin
cors
middleware
closures
Intermediate
9 steps
typescript
import { Controller, Get, Param, StreamableFile, Res, NotFoundException, Header } from '@nestjs/common'; import { Response } from 'express'; import { createReadStream, promises as fsp } from 'fs'; import { join } from 'path';
Streaming CSV file downloads in NestJS
file-streaming
http-headers
error-handling
Intermediate
7 steps
rust
use axum::{ extract::{Path, State}, http::{header, HeaderMap, StatusCode}, response::{IntoResponse, Response},
Optimistic concurrency with ETags in Axum
optimistic-concurrency
etag
http-headers
Intermediate
8 steps