Skip to content

Make Request.toCurl work more like Chrome's 'copy as cURL'#9112

Merged
swankjesse merged 2 commits intomasterfrom
jwilson.1006.curls
Oct 6, 2025
Merged

Make Request.toCurl work more like Chrome's 'copy as cURL'#9112
swankjesse merged 2 commits intomasterfrom
jwilson.1006.curls

Conversation

@swankjesse
Copy link
Copy Markdown
Collaborator

Changes:

  • single quotes
  • URL first
  • omit the default method

Also change binary detection to use isProbablyUtf8 instead, which is promoted to the main okhttp module.

Also replace the BinaryMode enum with a boolean to optionally not include the body.

Changes:
 - single quotes
 - URL first
 - omit the default method

Also change binary detection to use isProbablyUtf8
instead, which is promoted to the main okhttp module.

Also replace the BinaryMode enum with a boolean to
optionally not include the body.
@swankjesse
Copy link
Copy Markdown
Collaborator Author

Also needs a follow-up to use the body’s content type if it is present. (We prefer the body’s content-type if both are included)

@swankjesse swankjesse merged commit fdac86b into master Oct 6, 2025
29 checks passed
@swankjesse swankjesse deleted the jwilson.1006.curls branch October 6, 2025 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants