首页 > 解决方案 > XML 问题:内容类型 'text/xml; charset=ISO-8859-1' 不是预期的类型 'text/xml; 字符集=utf-8'

问题描述

你好我目前正在用java编写代码来发送一个post xml请求到一个url

response = given().relaxedHTTPSValidation().request().contentType("text/xml").body(new String(readFileContent(fileName, folderName, jsonObj, "xml", csvData))).when().post(url);

但是,当我的代码尝试运行代码时,我得到了一个:

HTTP/1.1 415 Cannot process the message because the content type 'text/xml; charset=ISO-8859-1' was not the expected type 'text/xml; charset=utf-8'.

我可以调试以找出问题所在的原因可能是什么?

标签: javaxmlpost

解决方案


推荐阅读