Heim  >  Fragen und Antworten  >  Hauptteil

大哥们再帮忙看看这个 java 2 php.

它们说的头部, 和用curl的header一个样吗?

  ...
  URL httpUrl = new URL(billing_url);
  HttpURLConnection http = (HttpURLConnection)httpUrl.openConnection();
  http.setRequestProperty("opcode", String.valueOf(opcode));    //头部
  http.setRequestProperty("appkey",appkey);             //头部
  http.setRequestProperty("sign", sign);            //头部
  http.setRequestProperty("tag", String.valueOf(tag));      //头部
  http.setRequestProperty("channelId",String.valueOf(channelId)); //头部
  http.setConnectTimeout(3000);
  http.setRequestMethod("POST"); //post方式
  http.setDoInput(true);
  http.setDoOutput(true);
  PrintWriter out = new PrintWriter(http.getOutputStream());
  out.print("data="+data); //注意data传递方式
  out.flush();
  ...
PHPzPHPz2772 Tage vor563

Antworte allen(3)Ich werde antworten

  • phpcn_u38476

    phpcn_u384762017-10-03 15:24:19

    大 哥们        再 帮忙 看看 这 个 ja      va 2 php.


    Antwort
    0
  • phpcn_u38476

    phpcn_u384762017-10-03 15:23:57

    大哥们再帮忙看看这个 java  2 php.


    Antwort
    0
  • phpcn_u38476

    phpcn_u384762017-10-03 15:23:46

    大哥们再帮忙看看这个 java 2 php.


    Antwort
    0
  • StornierenAntwort