The unsupported media type error suggests that your program did not specify the content-type header. You should generally specify two headers when you post the login request:content-type: application/json;charset=UTF-8
accept: application/json, text/...