Repository navigation
feat: return binary response bodies as base64 on request - #10
Merged
Merged
Conversation
http.request and http.session.request take an optional responseBody, text (the default) or base64. Text decodes the body as UTF-8, which replaces bytes that aren't UTF-8, so a binary body such as a charger's transaction archive couldn't reach the page intact. base64 answers the body's bytes as base64.
tygoegmond
pushed a commit
that referenced
this pull request
Oct 9, 2026
🤖 I have created a release *beep* *boop* --- ## [0.6.0](0.5.0...0.6.0) (2026-10-09) ### Features * return binary response bodies as base64 on request ([#10](#10)) ([5a71ad1](5a71ad1)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
http.requestandhttp.session.requesttake an optionalresponseBody:text(the default, as today) orbase64.Today both shells decode a response body as UTF-8 (iOS
String(decoding:as: UTF8.self), AndroidString(bytes, UTF_8)), which replaces bytes that aren't UTF-8. A binary body can't reach the page intact. The Link UI needs one: a Versinetic charger (Volt Time Source, Ratio io7) hands out its transaction history only as a.tar.gzdownload. WithresponseBody: "base64"the shell answers the body's bytes as base64, and the page decodes it.HTTP1.ResponseBody(text,base64), onHTTPSessions.RequestandHTTPService.Request, parsed byBridge.responseBody.Http1.ResponseBody, onHttpSessions.Requestand inLocalNetworkClient.request.textorbase64isinvalidParams. Absent keeps today's behaviour, so existing pages are unchanged.Tests: iOS
HTTPSessionTests,RequestParamsTests,HTTP1Tests,TLSSessionTests(71, simulator); AndroidHttp1Test,HttpSessionsTest(36).