PostMethod setRequestBody(String)已过时-为什么?

PostMethod setRequestBody(String)已过时-为什么?,第1张

PostMethod setRequestBody(String)已过时-为什么?

Javadoc说:

不推荐使用。使用setRequestEntity(RequestEntity)

RequestEntity有很多实现者,即:

ByteArrayRequestEntity,FileRequestEntity,InputStreamRequestEntity,MultipartRequestEntity,StringRequestEntity

使用适合您的一种:

  • 如果您的xml在中
    String
    ,请使用
    StringRequestEntity
  • 如果在文件中,请使用
    FileRequestEntity

等等。



欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/5131611.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-11-17
下一篇2022-11-17

发表评论

登录后才能评论

评论列表(0条)

    保存