-
-
Notifications
You must be signed in to change notification settings - Fork 88
Closed
Description
Hit this issue while playing with the create issue JIRA REST API:
val session = requests.Session(
auth = user -> password,
headers = Map("Content-Type" -> "application/json")
)
val fields: ujson.Obj = ???
val response = session.post(
url = "...",
data = ujson.Obj("fields" -> ujson.Obj.from(fields))
)
The above snippet always got a 415 Unsupported Media Type error. Setting the "Content-Type" header explicitly while posting the requests fixes this issue:
val response = session.post(
url = "...",
headers = Map("Content-Type" -> "application/json")
data = ujson.Obj("fields" -> ujson.Obj.from(fields)).render()
)
Further debugging showed that the "Content-Type: text/plain" header generated by StringRequestBlob
took a higher precedence than the one defined in session
.
Metadata
Metadata
Assignees
Labels
No labels