Releases: codemonster-ru/http
Releases · codemonster-ru/http
Release v2.0.0
Added
Request:files(),headers(),server(),fullUrlWithQuery(),only(),except(),withHeader(),withoutHeader(),withQuery(),withInput().Request:userAgent(),ip(),isSecure(),setTrustedProxies()andgetTrustedProxies()(IPv4/IPv6 CIDR).Response:sendFor(),sendHead(),withHeader(),withoutHeader(),withStatus(),withoutHeaders().Response:withHeaders()is now immutable.Response:withCookie(),withoutCookie(),cookie()with Set-Cookie support.Response::header()accepts arrays for multi-value headers (e.g.Set-Cookie).- Cookies:
SameSite=Noneautomatically addsSecure. Response:withType()for immutable content type changes.Response::json()supports customjson_encodeflags.
Changed
Breaking changes since 1.0.0:
Request::all()now returns merged query + body + files (previously returned meta array).Request::ip()andRequest::isSecure()now respectRequest::setTrustedProxies().Response::withHeaders()is now immutable (returns a new instance).Response::header()andResponse::withHeader()accept arrays for multi-value headers.Request::all()now returns merged query + body + files.Request::capture()supports method override viaX-HTTP-Method-Overrideand_method.Requestparsesapplication/x-www-form-urlencodedfrom raw body when$_POSTis empty.Requestnormalizes uploaded files (including nested structures).Request::only()andRequest::except()support dot-notation for nested data.Request::input()andRequest::query()support dot-notation.Request::files()supports dot-notation.Response::send()skips body for 204/304 and throws when headers are already sent.
Fixed
- README: corrected section headings and updated usage examples.
Release v1.0.0
Added
-
Request— lightweight immutable HTTP request object with:- method, URI, query, body, headers, and raw body accessors;
- JSON body parsing with
application/jsondetection; - full URL composition (
scheme(),host(),fullUrl()); - static factory
Request::capture()to build from PHP globals.
-
Response— HTTP response class with:- content, status, and headers management;
- helper methods:
json(),redirect(),type(), andempty(); - CLI-safe output via
send(); - string casting via
__toString().