Notes inconsistency with updating
Created by: stevepeak
When updating notes, without providing Content-Type: multipart/form-data
, the PUT
results in 400
missing body argument (even when provided).
Here is how you replicate using Python.
# Failes
import requests
res = requests.put('https://gitlab.com/api/v3/projects/187725/merge_requests/59639/notes/3006211',
headers={'Authorization': 'Bearer TOKEN'}, data='body=hello+world')
print res.text
>>> {"message":"400 (Bad request) \"body\" not given"}
# Works
res = requests.put('https://gitlab.com/api/v3/projects/187725/merge_requests/59639/notes/3006211',
headers={'Authorization': 'Bearer TOKEN', 'Content-Type': 'multipart/form-data'}, data='body=hello+world')
print res.status_code
>>> 200
GitLab API's should assume multipart/form-data
when no Content-Type
header is provided. The API does accept requests from other endpoints when no Content-Type
header is provided, as far as I've experienced it is only the Update Notes endpoint.