首页 > 编程知识 正文

java http请求(curl命令安装)

时间:2023-05-03 14:46:55 阅读:77177 作者:2571

I was able to locate some solutions,butnonehaveworkedforme.iamnewtojavaandhavehadnosuccesssofarwithcurlinjava。

curl-xpost-h ' content-type : application/JSON '-o output.JSON---data-binary @ input.JSON 3358 web adress

the JSON文件。

{

' firstNumber': '00 ',

' secondNumber': '12 ',

'类型' : ' my类型',

' data ' : [ 0,0,0,0,0 ]

}

anyhelpwouldbereallyappreciated。

解决方案

I ' vehadgoodexperiencewithspring ' Sr est template,here's a sample:

request.put(attribute1,value );

request.put(attribute2)、value2);

resttemplateresttemplate=newresttemplate (;

headers.set content type (media type.application _ JSON );

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。