Yes, you can simplify the curl command by letting curl automatically generate the boundary for you. Here’s how you can rewrite it:
bashcurl 'https://codeberg.org/Benjamin_Loison/Markdown/markup' \ -H 'Content-Type: multipart/form-data' \ -H 'Cookie: cb_sessionid=XXXXXXXXXXXXXXXXXXXX' \ -F 'mode=comment' \ -F 'text=$'"$'```python\nprint(\\'test\\')\n```'"
curl will generate its own boundary when the Content-Type header is set to multipart/form-data.-F for form data: This simplifies the construction of the multipart form data. You can pass the mode and text fields directly using -F.-F for the text field.This achieves the same result but is much cleaner and easier to maintain.
Le Chat can make mistakes. Check answers. Learn more