René's URL Explorer Experiment


Title: fix(http): send typed array, DataView and Blob request bodies by edusperoni · Pull Request #11654 · NativeScript/NativeScript · GitHub

Open Graph Title: fix(http): send typed array, DataView and Blob request bodies by edusperoni · Pull Request #11654 · NativeScript/NativeScript

X Title: fix(http): send typed array, DataView and Blob request bodies by edusperoni · Pull Request #11654 · NativeScript/NativeScript

Description: PR Checklist The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#commit-messages. There is an issue for the bug/feature this PR is for. To avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it. You have signed the CLA. All existing tests are passing: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/DevelopmentWorkflow.md#unit-testing. Tests for the changes are included - https://github.com/NativeScript/NativeScript/blob/master/tools/notes/WritingUnitTests.md. What is the current behavior? HttpRequestOptions.content is typed string | FormData | ArrayBuffer | Uint8Array, but the Android and iOS request layers only send string, FormData and ArrayBuffer content. Anything else goes out as an empty body, with no error: xhr.send(blob): the content is the Blob's internal Uint8Array; xhr.send(typedArray) and xhr.send(dataView): the content is never set; fetch(url, { body }) with a typed array, DataView or Blob, which all go through xhr.send; http.request({ content: uint8Array }). Separately, new Blob([view]) copied the view's whole underlying buffer instead of the bytes the view covers, so a Blob built from a subarray held extra bytes. What is the new behavior? A shared getRequestBodyBytes() returns an ArrayBuffer or any ArrayBuffer view as a Uint8Array over exactly the bytes it covers, without copying. Android sends those bytes through the same path as ArrayBuffer bodies, including the fast path from #11636 on newer runtimes. iOS sends them as NSData. A view that covers its whole buffer is passed as that buffer; otherwise only its range is copied out first. xhr.send passes typed arrays and DataViews through. The Blob constructor copies only the range a view covers. Verification Unit tests for getRequestBodyBytes (ArrayBuffer, a Uint16Array sub-view, a DataView, non-binary content). New apps/automated tests post JSON through xhr.send (typed array, DataView, Blob), fetch (typed array) and http.request (typed array) to the echo server and check the parsed JSON. Every body is a view in the middle of a buffer padded with x bytes, so a dropped body or an ignored byteOffset fails the test. Full apps/automated suite on an Android emulator (API 36): 1701 OK, 0 failed on @nativescript/android 9.1.1, and 1701 OK, 0 failed on a runtime built from android#2102 (9.1.3-pr2102), which takes the direct typed-array copy path. All five new tests pass on both. iOS was not run on a device. Its change only narrows a view to its byte range before the existing NSData.dataWithData(ArrayBuffer) call. Stacked on #11636.

Open Graph Description: PR Checklist The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#commit-messages. There is an issue for the bug/feature this...

X Description: PR Checklist The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#commit-messages. There is an issue for the bug/feature this...

Opengraph URL: https://github.com/NativeScript/NativeScript/pull/11654

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:c7674f12-a8a3-9040-9f7e-59032397685d
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9658:E9D16:B50A9F:E55F26:6B013054
html-safe-nonceb94f46751f9bd7ed4669bcafebe6e825e6e458d434c9c6437f5860ea5eabaf11
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NjU4OkU5RDE2OkI1MEE5RjpFNTVGMjY6NkIwMTMwNTQiLCJ2aXNpdG9yX2lkIjoiMTU3NDI3MjY5MjA2MzU2MDUyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacfdcab65370defd8fcad50f8b3b46396c69bcb232e27a8cdcb9c9a4c0e1c5909f
hovercard-subject-tagpull_request:5417023732
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/NativeScript/NativeScript/pull/11654/files
twitter:imagehttps://avatars.githubusercontent.com/u/4061767?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/4061767?s=400&v=4
og:image:altPR Checklist The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#commit-messages. There is an issue for the bug/feature this...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/NativeScript/NativeScript git https://github.com/NativeScript/NativeScript.git
octolytics-dimension-user_id7392261
octolytics-dimension-user_loginNativeScript
octolytics-dimension-repository_id31492490
octolytics-dimension-repository_nwoNativeScript/NativeScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id31492490
octolytics-dimension-repository_network_root_nwoNativeScript/NativeScript
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/NativeScript/NativeScript/pull/11654/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2FNativeScript%2Fpull%2F11654%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2FNativeScript%2Fpull%2F11654%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=NativeScript%2FNativeScript
Reloadhttps://github.com/NativeScript/NativeScript/pull/11654/files
Reloadhttps://github.com/NativeScript/NativeScript/pull/11654/files
Reloadhttps://github.com/NativeScript/NativeScript/pull/11654/files
NativeScripthttps://github.com/NativeScript
NativeScripthttps://github.com/NativeScript/NativeScript
Codehttps://github.com/NativeScript/NativeScript
Issues231 (231)https://github.com/NativeScript/NativeScript/issues
Pull requests107 (107)https://github.com/NativeScript/NativeScript/pulls
Discussionshttps://github.com/NativeScript/NativeScript/discussions
Actionshttps://github.com/NativeScript/NativeScript/actions
Projectshttps://github.com/NativeScript/NativeScript/projects
Wikihttps://github.com/NativeScript/NativeScript/wiki
Security and qualityhttps://github.com/NativeScript/NativeScript/security
Insightshttps://github.com/NativeScript/NativeScript/insights
Sign up for GitHub https://github.com/signup?return_to=%2FNativeScript%2FNativeScript%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FNativeScript%2FNativeScript%2Fissues%2Fnew%2Fchoose
edusperonihttps://github.com/edusperoni
perf/android-buffers-readtexthttps://github.com/NativeScript/NativeScript/tree/perf/android-buffers-readtext
fix/http-binary-request-bodieshttps://github.com/NativeScript/NativeScript/tree/fix/http-binary-request-bodies
Conversation 2 https://github.com/NativeScript/NativeScript/pull/11654
Commits 1 https://github.com/NativeScript/NativeScript/pull/11654/commits
Checks 9 https://github.com/NativeScript/NativeScript/pull/11654/checks
Files changed 8 https://github.com/NativeScript/NativeScript/pull/11654/files
fix(http): send typed array, DataView and Blob request bodies https://github.com/NativeScript/NativeScript/pull/11654/files#top
Show all changes 1 commit https://github.com/NativeScript/NativeScript/pull/11654/files
c20960a fix(http): send typed array, DataView and Blob request bodies edusperoni Nov 20, 2026 https://github.com/NativeScript/NativeScript/pull/11654/commits/c20960ab0dca147b9adf862a412d9633449b5dc9
Clear filters https://github.com/NativeScript/NativeScript/pull/11654/files
Please reload this pagehttps://github.com/NativeScript/NativeScript/pull/11654/files
Please reload this pagehttps://github.com/NativeScript/NativeScript/pull/11654/files
fetch-tests.ts https://github.com/NativeScript/NativeScript/pull/11654/files#diff-3d2582aa100562965e9ff68b93dad5469d9bbf47f6c97f0627aa4a9ccb459d80
http-tests.ts https://github.com/NativeScript/NativeScript/pull/11654/files#diff-44ae3915625018e40b43d2041defd3a14c14b00c438436495ab10f3526cef73c
xhr-tests.ts https://github.com/NativeScript/NativeScript/pull/11654/files#diff-f967ae1fe2df5821200f14925a96eebacd0cd9d7d2c9443ad0d7686bb68a2fb9
http-request-internal-common.spec.ts https://github.com/NativeScript/NativeScript/pull/11654/files#diff-19ac450d147bb923386fff3cd566e6f41f8860b2a8add410416f74ae8689d478
http-request-internal-common.ts https://github.com/NativeScript/NativeScript/pull/11654/files#diff-3c5616b1534266572a96051b2d0efe365fc288c65db64ca52eeb272086b3a956
index.android.ts https://github.com/NativeScript/NativeScript/pull/11654/files#diff-5570277e416590db705250da970784cccb5522dd365b87ff1c1f0b500e3b0802
index.ios.ts https://github.com/NativeScript/NativeScript/pull/11654/files#diff-d4826bb70fb1a2d7ff9f2e98b20373647cc7493c2236d797544812a52bb099dd
index.ts https://github.com/NativeScript/NativeScript/pull/11654/files#diff-542233a8e7bf4d2819f29ed4d14462acf3135450c153d186457e1f6b00e6a513
apps/automated/src/fetch/fetch-tests.tshttps://github.com/NativeScript/NativeScript/pull/11654/files#diff-3d2582aa100562965e9ff68b93dad5469d9bbf47f6c97f0627aa4a9ccb459d80
View file https://github.com/NativeScript/NativeScript/blob/c20960ab0dca147b9adf862a412d9633449b5dc9/apps/automated/src/fetch/fetch-tests.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/NativeScript/pull/11654/{{ revealButtonHref }}
https://github.com/NativeScript/NativeScript/pull/11654/files#diff-3d2582aa100562965e9ff68b93dad5469d9bbf47f6c97f0627aa4a9ccb459d80
apps/automated/src/http/http-tests.tshttps://github.com/NativeScript/NativeScript/pull/11654/files#diff-44ae3915625018e40b43d2041defd3a14c14b00c438436495ab10f3526cef73c
View file https://github.com/NativeScript/NativeScript/blob/c20960ab0dca147b9adf862a412d9633449b5dc9/apps/automated/src/http/http-tests.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/NativeScript/pull/11654/{{ revealButtonHref }}
https://github.com/NativeScript/NativeScript/pull/11654/files#diff-44ae3915625018e40b43d2041defd3a14c14b00c438436495ab10f3526cef73c
apps/automated/src/xhr/xhr-tests.tshttps://github.com/NativeScript/NativeScript/pull/11654/files#diff-f967ae1fe2df5821200f14925a96eebacd0cd9d7d2c9443ad0d7686bb68a2fb9
View file https://github.com/NativeScript/NativeScript/blob/c20960ab0dca147b9adf862a412d9633449b5dc9/apps/automated/src/xhr/xhr-tests.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/NativeScript/pull/11654/{{ revealButtonHref }}
https://github.com/NativeScript/NativeScript/pull/11654/files#diff-f967ae1fe2df5821200f14925a96eebacd0cd9d7d2c9443ad0d7686bb68a2fb9
packages/core/http/http-request-internal/http-request-internal-common.spec.tshttps://github.com/NativeScript/NativeScript/pull/11654/files#diff-19ac450d147bb923386fff3cd566e6f41f8860b2a8add410416f74ae8689d478
View file https://github.com/NativeScript/NativeScript/blob/c20960ab0dca147b9adf862a412d9633449b5dc9/packages/core/http/http-request-internal/http-request-internal-common.spec.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/NativeScript/pull/11654/{{ revealButtonHref }}
https://github.com/NativeScript/NativeScript/pull/11654/files#diff-19ac450d147bb923386fff3cd566e6f41f8860b2a8add410416f74ae8689d478
packages/core/http/http-request-internal/http-request-internal-common.tshttps://github.com/NativeScript/NativeScript/pull/11654/files#diff-3c5616b1534266572a96051b2d0efe365fc288c65db64ca52eeb272086b3a956
View file https://github.com/NativeScript/NativeScript/blob/c20960ab0dca147b9adf862a412d9633449b5dc9/packages/core/http/http-request-internal/http-request-internal-common.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/NativeScript/pull/11654/{{ revealButtonHref }}
https://github.com/NativeScript/NativeScript/pull/11654/files#diff-3c5616b1534266572a96051b2d0efe365fc288c65db64ca52eeb272086b3a956
packages/core/http/http-request-internal/index.android.tshttps://github.com/NativeScript/NativeScript/pull/11654/files#diff-5570277e416590db705250da970784cccb5522dd365b87ff1c1f0b500e3b0802
View file https://github.com/NativeScript/NativeScript/blob/c20960ab0dca147b9adf862a412d9633449b5dc9/packages/core/http/http-request-internal/index.android.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/NativeScript/pull/11654/{{ revealButtonHref }}
https://github.com/NativeScript/NativeScript/pull/11654/files#diff-5570277e416590db705250da970784cccb5522dd365b87ff1c1f0b500e3b0802
https://github.com/NativeScript/NativeScript/pull/11654/files#diff-5570277e416590db705250da970784cccb5522dd365b87ff1c1f0b500e3b0802
https://github.com/NativeScript/NativeScript/pull/11654/files#diff-5570277e416590db705250da970784cccb5522dd365b87ff1c1f0b500e3b0802
https://github.com/NativeScript/NativeScript/pull/11654/files#diff-5570277e416590db705250da970784cccb5522dd365b87ff1c1f0b500e3b0802
packages/core/http/http-request-internal/index.ios.tshttps://github.com/NativeScript/NativeScript/pull/11654/files#diff-d4826bb70fb1a2d7ff9f2e98b20373647cc7493c2236d797544812a52bb099dd
View file https://github.com/NativeScript/NativeScript/blob/c20960ab0dca147b9adf862a412d9633449b5dc9/packages/core/http/http-request-internal/index.ios.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/NativeScript/pull/11654/{{ revealButtonHref }}
https://github.com/NativeScript/NativeScript/pull/11654/files#diff-d4826bb70fb1a2d7ff9f2e98b20373647cc7493c2236d797544812a52bb099dd
https://github.com/NativeScript/NativeScript/pull/11654/files#diff-d4826bb70fb1a2d7ff9f2e98b20373647cc7493c2236d797544812a52bb099dd
https://github.com/NativeScript/NativeScript/pull/11654/files#diff-d4826bb70fb1a2d7ff9f2e98b20373647cc7493c2236d797544812a52bb099dd
https://github.com/NativeScript/NativeScript/pull/11654/files#diff-d4826bb70fb1a2d7ff9f2e98b20373647cc7493c2236d797544812a52bb099dd
packages/core/xhr/index.tshttps://github.com/NativeScript/NativeScript/pull/11654/files#diff-542233a8e7bf4d2819f29ed4d14462acf3135450c153d186457e1f6b00e6a513
View file https://github.com/NativeScript/NativeScript/blob/c20960ab0dca147b9adf862a412d9633449b5dc9/packages/core/xhr/index.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/NativeScript/pull/11654/{{ revealButtonHref }}
https://github.com/NativeScript/NativeScript/pull/11654/files#diff-542233a8e7bf4d2819f29ed4d14462acf3135450c153d186457e1f6b00e6a513
https://github.com/NativeScript/NativeScript/pull/11654/files#diff-542233a8e7bf4d2819f29ed4d14462acf3135450c153d186457e1f6b00e6a513
https://github.com/NativeScript/NativeScript/pull/11654/files#diff-542233a8e7bf4d2819f29ed4d14462acf3135450c153d186457e1f6b00e6a513
https://github.com/NativeScript/NativeScript/pull/11654/files#diff-542233a8e7bf4d2819f29ed4d14462acf3135450c153d186457e1f6b00e6a513
Please reload this pagehttps://github.com/NativeScript/NativeScript/pull/11654/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.