Skip to content

Commit e8cc358

Browse files
committed
Fix base64 encoding example for URL quoting
I forgot to run the example through URL quoting, which is necessary.
1 parent d8f0140 commit e8cc358

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

versions/3.0.4.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1726,9 +1726,13 @@ Given a name of `example` and a solid red 2x2-pixel PNG for `icon`, this
17261726
would produce a request body of:
17271727

17281728
```urlencoded
1729-
name=example&icon=iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAEklEQVQIW2P8z8AARAwMjDAGACwBA/+8RVWvAAAAAElFTk
1729+
name=example&icon=iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAABGdBTUEAALGPC%2FxhBQAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAAqADAAQAAAABAAAAAgAAAADO0J6QAAAAEElEQVQIHWP8zwACTGCSAQANHQEDqtPptQAAAABJRU5ErkJggg%3D%3D
17301730
```
17311731

1732+
Note that this base64-encoded value had to be futher percent-encoded, replacing `/` with `%2F` and each of two final `=` padding characters with `%3D`.
1733+
Some base64-decoding implementations may be able to use the string without the padding per [RFC4648 §3.2](https://datatracker.ietf.org/doc/html/rfc4648#section-3.2).
1734+
However, this is not guaranteed and the value would still need to be percent-decoded due to the `%2F`.
1735+
17321736
##### Encoding `multipart` Media Types
17331737

17341738
It is common to use `multipart/form-data` as a `Content-Type` when transferring forms as request bodies. In contrast to 2.0, a `schema` is REQUIRED to define the input parameters to the operation when using `multipart` content. This supports complex structures as well as supporting mechanisms for multiple file uploads.

0 commit comments

Comments
 (0)