Skip to content

Commit f6c2164

Browse files
committed
Fix base64 encoding example for URL quoting (3.1.1 port of 2923 5/6)
I forgot to run the example through URL quoting, which is necessary.
1 parent 4c988a2 commit f6c2164

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

versions/3.1.1.md

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

17981798
```urlencoded
1799-
name=example&icon=iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAEklEQVQIW2P8z8AARAwMjDAGACwBA/+8RVWvAAAAAElFTk
1799+
name=example&icon=iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAABGdBTUEAALGPC_xhBQAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAAqADAAQAAAABAAAAAgAAAADO0J6QAAAAEElEQVQIHWP8zwACTGCSAQANHQEDqtPptQAAAABJRU5ErkJggg%3D%3D
18001800
```
18011801

1802+
Note that the `=` padding characters at the end need to be percent-encoded, even with the "URL safe" `contentEncoding: base64url`.
1803+
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).
1804+
However, this is not guaranteed, so it may be more interoperable to keep the padding and rely on percent-decoding.
1805+
18021806
##### Encoding `multipart` Media Types
18031807

18041808
It is common to use `multipart/form-data` as a `Content-Type` when transferring request bodies to operations. 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)