finds.dev← search

// the find

mxcl/OMGHTTPURLRQ

★ 336 · Objective-C · MIT · updated Jun 2026

Vital extensions to NSURLRequest that Apple left out for some reason.

A small Objective-C helper for building NSURLRequest/NSMutableURLRequest objects for GET/POST/PUT/DELETE and multipart/form-data uploads, written by mxcl (the Homebrew creator) back when NSURLConnection and manual multipart encoding were still something you had to do by hand. Useful if you're maintaining an old Obj-C codebase that never moved past NSURLSession's raw APIs.

The multipart/form-data builder (OMGMultipartFormData) actually gets the boundary encoding and content-type headers right, which is the part people reliably get wrong writing this by hand. It also documents and solves the specific NSURLSessionUploadTask gotcha where upload tasks send raw bytes instead of your constructed multipart body — a real, easy-to-miss bug. Ships a Package.swift alongside the podspec, so it's usable from SwiftPM even though the code itself is Obj-C.

Built entirely around NSURLConnection and manual NSMutableURLRequest construction, both of which URLSession with Codable/async-await have made unnecessary for any app written in the last several years. No Swift-native API at all — you're bridging Obj-C into a Swift project for something URLSession.uploadTask(with:from:completionHandler:) mostly covers today. The Twitter reverse-auth section depends on TDOAuth, a long-dormant library, and SLRequest/Accounts framework APIs that Apple deprecated and later removed outright, so that part of the README is effectively dead documentation. Single-file source layout (OMGHTTPURLRQ.m) with no retry, timeout, or error-handling story beyond what NSURLRequest gives you for free.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →