Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/384.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/tensorflow/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将cURL转换为parse.com的java?_Java_Php_Curl_Parse Platform - Fatal编程技术网

将cURL转换为parse.com的java?

将cURL转换为parse.com的java?,java,php,curl,parse-platform,Java,Php,Curl,Parse Platform,我真的很挣扎。。。解析文档给出了如何使用curl发送推送的示例: curl -X POST \ -H "X-Parse-Application-Id: myAppId" \ -H "X-Parse-REST-API-Key: myAppKey" \ -H "Content-Type: application/json" \ -d '{ "channels": [ "Giants", "Mets" ], "data": { "al

我真的很挣扎。。。解析文档给出了如何使用curl发送推送的示例:

curl -X POST \
 -H "X-Parse-Application-Id: myAppId" \
 -H "X-Parse-REST-API-Key: myAppKey" \
 -H "Content-Type: application/json" \
 -d '{
    "channels": [
      "Giants",
      "Mets"
    ],
    "data": {
      "alert": "The Giants won against the Mets 2-3."
    }
  }' \
  https://api.parse.com/1/push

对于桌面java程序,我如何在普通java中实现这一点?

我不是在为您编写代码,也不是在为您进行研究

但是解决这样一个问题的方法是把它分解成子问题。例如:

  • 如何在Java中发送HTTP请求
  • 如何在Java中发送POST请求
  • 如何在请求正文中传递内容
  • 如何设置内容类型
  • 如何传递非标准请求头
  • 如何构造JSON
  • 如何处理回应

对不起。。。这不是程序编写服务。