Reference
Common Headers
Standard HTTP headers used across SamaySetu JSON APIs and binary schedule exports.
Request Headers
| Header | Required | Description | Example |
|---|---|---|---|
Authorization | On protected routes | Bearer JWT issued by POST /auth/login | Bearer YOUR_JWT_TOKEN |
Content-Type | On JSON POST/PUT requests | Standard JSON encoding | application/json |
Accept | Recommended | Preferred response representation | application/json |
Export Response Headers
Timetable export endpoints return downloadable PDF or Excel documents directly as binary streams:
| Export Format | Response Content-Type | Response Content-Disposition |
|---|---|---|
PDF (/pdf) | application/pdf | attachment; filename=timetable_<scope>_<id>.pdf |
Excel (/excel) | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | attachment; filename=timetable_<scope>_<id>.xlsx |
When consuming export routes from browser fetch or Node/Java HTTP clients, read binary bytes (res.arrayBuffer() or HttpResponse.BodyHandlers.ofByteArray()) rather than calling .json().
