Commit graph

29 commits

Author SHA1 Message Date
f8f91427ad
Rename License.txt to License.md 2025-06-29 13:44:42 -07:00
80bade5c28
Merge pull request #2 from samsonjs/codable-request
Add Codable support and overhaul the API
2025-06-24 00:09:27 -04:00
d2576b729e
Add Codable support and overhaul the API
This introduces a cleaner, more intuitive API for making HTTP requests
with explicit methods for different content types and built-in Codable
support.

**New**
  - Add explicit request methods: .postJSON(), .postForm(),
    .postMultipart() for clear intent
  - Add direct `Codable` body support with automatic JSON
    encoding/decoding
  - Add `HTTPRequestBody` enum for internal type safety and cleaner
    implementation
  - Add proper query parameter encoding for GET and DELETE requests
    (previously ignored)
  - Add URLSession extensions for streamlined async JSON decoding with
    `HTTPError` for failure response status codes
  - Add comprehensive test coverage

The new API replaces the parameter-based methods using dictionaries with
explicitly-typed ones. Instead of passing a content-type parameter, you
now use purpose-built methods like `postJSON` and `postForm`.

**Breaking changes**
  - Minimum deployment targets raised to iOS 16.0 and macOS 13.0
  - Direct access to `parameters` and `parts` properties deprecated on
    `HTTPRequest`
  - GET and DELETE requests now validate that they don't have request
    bodies, and the new API prevents you from constructing them
2025-06-23 23:55:55 -04:00
955cb19c98
Update changelog for unreleased changes 2025-06-15 17:03:10 -07:00
59a11b9cee
Prepare for 2.0.1 release 2025-06-15 17:02:10 -07:00
bc3ce2c93e
Fix stray question marks 2025-06-15 16:59:44 -07:00
bcf402db8f
Remove Linux testing cruft that we no longer need 2025-06-15 08:38:19 -07:00
9189796756
Fix readme formatting 2025-06-15 08:36:58 -07:00
374e456641
Update changelog for unreleased changes 2025-06-15 08:34:48 -07:00
ff3b0b6e12
Prepare for 2.0.0 release 2025-06-15 08:34:21 -07:00
310607ed00
Merge pull request #2 from samsonjs/modernize
Modernize and make it a real Swift package
2025-06-15 08:29:50 -07:00
77446ccf2d
Add support for query params on GET and DELETE requests 2025-06-15 08:26:22 -07:00
863d712e42
Remove unnecessary return statements 2025-06-15 08:18:43 -07:00
4615329e46
Modernize, add tests, remove assertions 2025-06-15 07:41:45 -07:00
41334e85e4
Add 0dependencies.dev badge 2024-10-31 11:55:45 -07:00
8a7e6f5bdd
Fix code example in readme 2023-02-01 00:08:02 -08:00
e5c761ffb8
Fix binary data in HTTP.swift 2023-02-01 00:00:58 -08:00
063d346567
Fix copyright 2023-02-01 00:00:39 -08:00
425da2ec07
Merge branch '1SecondEveryday:main' into main 2022-02-07 21:52:18 -08:00
15f820bd91
Change HTTPRequest from class to struct 2022-02-06 23:46:35 -08:00
bb21568d17
Fix encoding empty fields and flesh out tests 2021-02-03 16:07:03 -08:00
a0789e95da
Remove property that was only used once 2021-01-07 13:46:35 -08:00
3f17ecb3af
Change multipart form boundary string 2021-01-07 13:42:36 -08:00
e383d188f2
Add a way to encode multipart forms to a file 2020-11-16 15:24:07 -08:00
012ff20c96 Get rid of some pointless mutable state 2020-10-20 21:09:53 -07:00
Sami Samhuri
0bcf8fe801
Merge pull request #1 from samsonjs/feature/swiftpm-and-multipart-tests
Convert to Swift package and rewrite the multipart encoder
2020-10-20 20:29:10 -07:00
c1f4320288 Convert to Swift package and rewrite the multipart encoder 2020-10-20 20:25:14 -07:00
41769a99e8
add some more HTTP utilities 2017-08-24 12:09:39 -07:00
b685df4e90
first commit 2017-08-24 10:10:57 -07:00