Skip to content

Instantly share code, notes, and snippets.

@akira1908jp
Created February 12, 2013 08:01
Show Gist options
  • Save akira1908jp/4760864 to your computer and use it in GitHub Desktop.
Save akira1908jp/4760864 to your computer and use it in GitHub Desktop.
sample php
<?php
require_once 'HTTP/Request.php';
$format =
// 'json'
// 'xml'
'';
$url = "http://157.109.211.138:8180/apolloLog.php/add?format=$format&title_id=999&action_type=ADMINCMD_USE&action_date=2012-04-26%2001:22:45.65432&user_id=%27123%27&World_name=%27101_soc01%27&value1%27PIKO%27&value2=%[email protected]%27&value3=%27123.45.67.89%27&value4=%22s%20addcp%2099999%22";
$req =& new HTTP_Request($url);
if (!PEAR::isError($req->sendRequest())) {
$res = $req->getResponseBody();
// レスポンスハンドリングコードを記述
var_dump($res);
/**
* レスポンスボディ
*
* json形式
* string(25) "{"response":{"status":0}}"
*
* xml形式
* string(83) "<?xml version="1.0" encoding="UTF-8"?>
* <response>
* <status>0</status>
* </response>
* "
* text形式
* string(1) "0"
*
*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment