@@ -5,6 +5,37 @@ All notable changes to this project will be documented in this file.
55The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.1.0/ ) ,
66and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
77
8+ ## [ 5.6.0] ( https://github.com/SocketDev/socket-lib/releases/tag/v5.6.0 ) - 2026-02-08
9+
10+ ### Added
11+
12+ - ** http-request** : Added automatic default headers for JSON and text requests
13+ - ` httpJson() ` now automatically sets ` Accept: application/json ` header
14+ - ` httpJson() ` automatically sets ` Content-Type: application/json ` when body is present
15+ - ` httpText() ` now automatically sets ` Accept: text/plain ` header
16+ - ` httpText() ` automatically sets ` Content-Type: text/plain ` when body is present
17+ - User-provided headers always override defaults
18+ - Simplifies API usage - no need to manually set common headers
19+
20+ ### Changed
21+
22+ - ** http-request** : Renamed HTTP helper functions to support all HTTP methods (BREAKING CHANGE)
23+ - ` httpGetJson() ` → ` httpJson() ` - Now supports GET, POST, PUT, DELETE, PATCH, etc.
24+ - ` httpGetText() ` → ` httpText() ` - Now supports all HTTP methods via ` method ` option
25+ - Functions now accept ` method ` parameter in options (defaults to 'GET')
26+ - More flexible API that matches modern fetch-style conventions
27+ - ** Migration** : Replace ` httpGetJson() ` calls with ` httpJson() ` and ` httpGetText() ` with ` httpText() `
28+
29+ ### Fixed
30+
31+ - ** http-request** : Fixed Content-Type header incorrectly sent with empty string body
32+ - Empty string body (` "" ` ) no longer triggers Content-Type header
33+ - Changed condition from ` if (body !== undefined) ` to ` if (body) ` for semantic correctness
34+ - Empty string represents "no content" and should not declare a Content-Type
35+ - Affects ` httpJson() ` and ` httpText() ` functions
36+ - Fixes potential API compatibility issues with servers expecting no Content-Type for empty bodies
37+ - Added comprehensive test coverage for empty string edge case
38+
839## [ 5.5.3] ( https://github.com/SocketDev/socket-lib/releases/tag/v5.5.3 ) - 2026-01-20
940
1041### Fixed
0 commit comments