Add Multipart File Upload & Cookie Management Features #25
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds two major features to Transport PHP:
Both features are production-ready with comprehensive testing and documentation.
Feature 1: Multipart/Form-Data File Upload
New Components
src/Multipart/Part.php- Represents individual multipart form partssrc/Multipart/MultipartStreamBuilder.php- Builds RFC 7578 compliant multipart streamstests/Multipart/MultipartTest.php- 25+ comprehensive testsexamples/file-upload.php- 7 practical usage examplesCapabilities
API Usage
Feature 2: Cookie Management
New Components
src/Cookie/Cookie.php- RFC 6265 compliant cookie classsrc/Cookie/CookieJar.php- Cookie storage with domain/path matchingsrc/Middleware/CookieMiddleware.php- Automatic cookie handlingtests/Cookie/CookieTest.php- 33+ comprehensive testsexamples/cookie-session.php- 8 practical usage examplesCapabilities
API Usage
Code Quality
Testing
Code Style
Documentation
Files Changed
New Files (9)
src/Multipart/Part.phpsrc/Multipart/MultipartStreamBuilder.phpsrc/Cookie/Cookie.phpsrc/Cookie/CookieJar.phpsrc/Middleware/CookieMiddleware.phptests/Multipart/MultipartTest.phptests/Cookie/CookieTest.phpexamples/file-upload.phpexamples/cookie-session.phpModified Files (3)
src/RequestBuilder.php- Added multipart methodssrc/TransportBuilder.php- Added cookie supportREADME.md- Added feature documentationStats
Breaking Changes
None - This PR is fully backward compatible with existing code.
Test Plan
Use Cases
For API Clients
For Web Scraping
Implementation Notes
Related Issues
Implements features requested for API client and web scraping use cases.
Checklist