How can I upload an image to the description of a snippet that is not part of a project? · python-gitlab/python-gitlab · Discussion #3253 · GitHub
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
-
Heading
-
Bold
-
Italic
-
Quote
-
Code
-
Link
-
Numbered list
-
Unordered list
-
Task list
-
Attach files
-
Mention
-
Reference
👍
1
reacted with thumbs up emoji
👎
1
reacted with thumbs down emoji
😄
1
reacted with laugh emoji
🎉
1
reacted with hooray emoji
😕
1
reacted with confused emoji
❤️
1
reacted with heart emoji
🚀
1
reacted with rocket emoji
👀
1
reacted with eyes emoji
Footer
You can’t perform that action at this time.
Uh oh!
There was an error while loading. Please reload this page.
{{title}}
Uh oh!
There was an error while loading. Please reload this page.
-
I can create snippets, with a description and files, but cannot find how I can include an image in the description.
This is specifically for snippets that are "personal", i.e. not associated with a project.
By observing the browser network traffic I found that when I paste an image into the snippet description a POST call is made to https://<my-gitlab-instance>/uploads/personal_snippet?id=<my-user-id> with the image being sent as binary data. The call returns a relative URL that can then be included in the Markdown description.
However, I can't recreate that call using curl, or Python requests.
Does somebody have an example of how you can upload an image in the description?
Context
I am trying to migrate my snippets from one Gitlab instance to another.
Downloading the images from the source instance now works by extracting image url's from the Markdown description and downloading the url's using a request.session with the appropriate cookies (obtained with rookiepy).
However, uploading that image proofs to be hard as I can't figure out the correct POST call.
Beta Was this translation helpful? Give feedback.