你如何翻译curl -d" 65"到java httpput条目?我需要在这个使用java apache http库的java链接中执行curl命令。
Acquiring and changing basic data on the Nest thermostat
这是curl命令:
curl -v -L -X PUT" https://developer-api.nest.com/devices/thermostats/THERMOSTAT_ID/target_temperature_f?auth=AUTH_CODE" -H" Content-Type:application / json" -d" 65"
这是我的java代码:
httpPut.setHeader("Content-Type", "application/json");
HttpEntity put_entity = new StringEntity("65"); // Problem is here, I think!
httpPut.setEntity(put_entity); // or here!
HttpResponse put_response = httpclient.execute(httpPut);