java - Is content-type "text/xml; charset=utf-8" wrong -
i making httprequest , specifying content-type follows code review senior developers gets rejected.
val request = requestbuilder.post .seturi(metadata("serviceuri")) .addheader("content-type", "text/xml; charset=utf-8") .setentity(input) .build they mention error like:
java.nio.charset.illegalcharsetnameexception: text/xml; charset=utf-8 however not receive these errors when run code on local machine. missing something? checked on internet @ many places , considered correct: "text/xml; charset=utf-8"
i sorry, not pro, if in case, try these:
-writing charset "utf-8" (uppercase), -or instead of putting ";" after text/xml, putting "," (comma) -or try use setheader option
again, not pro, these found searching on internet error got. hope of may helpful you.
Comments
Post a Comment