You need to include the content-type from the content-type header here or it will get inferred as text/plain. In spray the content-type lives with the entity, the actual header is ignored