This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Public domain - https://gist.github.com/nolanw/14b277903a2ba446f75202a6bfd55977 | |
import Foundation | |
extension URLRequest { | |
/** | |
Configures the URL request for `application/x-www-form-urlencoded` data. The request's `httpBody` is set, and values are set for HTTP header fields `Content-Type` and `Content-Length`. | |
- Parameter queryItems: The (name, value) pairs to encode and set as the request's body. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Public domain - https://gist.github.com/nolanw/dff7cc5d5570b030d6ba385698348b7c | |
import Foundation | |
extension URLRequest { | |
/** | |
Configures the URL request for `multipart/form-data`. The request's `httpBody` is set, and a value is set for the HTTP header field `Content-Type`. | |
- Parameter parameters: The form data to set. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Lil loading tool for JWCC: JSON With Commas and Comments. | |
# See docstrings for loads() and jwcc2json() for more info. | |
# Public domain. | |
import json | |
import re | |
_INTERESTING_B = re.compile(rb''' | |
\] # array end | |
| \} # object end | |
| (?<! \\)" # string start |
OlderNewer