Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
URL: http://github.com/python-gitlab/python-gitlab/discussions/3253
.com/assets/github-a042f5a27a556c42.css" />
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.sessionwith the appropriate cookies (obtained withrookiepy).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.
All reactions