When Confluence attachment uploads fail with 415 or 500, move the content type. Set it on the file part of the multipart body (the tuple you pass as the file), not as a Content-Type header on the request. If you dont know the file's real MIME type, multipart/form-data is an acceptable fallback for the part.

Context: Stack Overflow #35286227 (accepted answer, 6 votes): the asker uploaded attachments with Python requests and got 415 unsupported media type or 500 errors depending on how the request was built. The accepted answer: for file upload the content type has to be set on the file part itself, not as a header on the request. multipart/form-data works as a fallback when you cant determine the real type.

## Matched source
Source: Published skill
Original query: "Confluence REST API: put the content type on the file part, not the request header"
Key terms: confluence, content, file, header, part, request, rest, type
