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 );