Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cURL command for easier copy-pasting #2642

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

EliaCereda
Copy link

Print a backslash at the end of each line in the cURL command printed by URLSession requests, so that the command can be directly copy-pasted in the Terminal

Print a backslash at the end of each line in the cURL command printed by URLSession requests, so that the command can be directly copy-pasted in the Terminal
@danielt1263
Copy link
Collaborator

Great addition! However, it doesn't handle the optional body correctly. Also, you might consider switching to using #"..."# syntax to make things a bit less confusing.

@EliaCereda
Copy link
Author

It’s not clear to me what you mean exactly. Multi-line bodies work out of the box for me, since the body is inside quotes and those newlines don’t break the command.

Let me know if there is a specific case that is broken for you

@freak4pc
Copy link
Member

The fix looks good. If you don't mind I would switch to use # delimiters so you can do less escaping with slashes and juse use \n. Maintaining / debugging this will be painful later on :)

Let me know your thoughts 💪

@EliaCereda
Copy link
Author

Yes, I understand your point, it's a good point. I don't have my computer on hand to test this right now, if you want just go ahead and make the change yourself ;)

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.

3 participants