You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/basic-usage.md
+90-13Lines changed: 90 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -1,23 +1,34 @@
1
1
Parsing and Serializing Structured Fields
2
2
------------
3
3
4
-
an HTTP field value can be:
5
-
6
-
- an [Item](item.md);
7
-
- a [Dictionary](ordered-maps.md);
8
-
- a [List](lists.md);
9
-
10
-
For each of these top-level types, the package provides a dedicated object to parse the textual
11
-
representation of the field and to serialize the value object back to the textual representation.
12
-
13
-
- Parsing is done via a common named constructor `fromHttpValue` which expects the Header or Trailer string value.
14
-
- Serializing is done via a common `toHttpValue` public method or using the `__toString` method. The method returns the **normalized string** representation suited for HTTP textual representation.
4
+
To parse an HTTP field you may use the `fromHttpValue` named constructor provided by all the
[](https://github.com/sponsors/nyamsprod)
10
10
11
-
The package uses value objects to parse, serialize, build and update [HTTP Structured Fields][1] in PHP.
11
+
The package provides an expressive, minimal API around the [HTTP Structured Fields RFC][1] in PHP.
12
+
It allows the user to quickly parse, serialize, build and update HTTP fields in a predicable way.
12
13
13
-
HTTP Structured fields are intended for use by specifications of new HTTP fields that wish to
14
-
use a common syntax that is more restrictive than traditional HTTP field values or could
15
-
be used to [retrofit current headers][2] to have them compliant with the new syntax.
16
-
17
-
The package can be used to:
18
-
19
-
- parse and serialize HTTP Structured Fields
20
-
- build or update HTTP Structured Fields in a predicable way;
0 commit comments