From this documentation : Projects API | GitLab
I want to save this response into a variable :
{
"alt": "dk",
"url": "/uploads/66dbcd21ec5d24ed6ea225176098d52b/dk.png",
"full_path": "/namespace1/project1/uploads/66dbcd21ec5d24ed6ea225176098d52b/dk.png",
"markdown": "![dk](/uploads/66dbcd21ec5d24ed6ea225176098d52b/dk.png)"
}
I tried 2 things but didn’t work for me :
1.
json=$(curl --request POST --header “PRIVATE-TOKEN:” --header “Content-Type:multipart/form-data” --form “file=@./ticket.json” “https://gitlab.com/api/v4/projects/uploads”)
json=`curl --request POST --header “PRIVATE-TOKEN:” --header “Content-Type:multipart/form-data” --form “file=@./ticket.json” “https://gitlab.com/api/v4/projects/uploads” ``
both these methods doesn’t work for me .