我最近使用PHP調用C#ServiceStack服務。它是這樣的:
$content = json_encode($yourServiceMethodsArgumentShapeInstance);
$curl = curl_init($endpointUrl);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-type: application/json"));
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $content);
$jsonResponse = curl_exec($curl);
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
你能告訴我這是REST還是SOAP調用?謝謝。 –
@DukaNikolau它將被歸類爲REST(使用該首字母縮略詞的鬆散解釋)。 – bluevector
如果我必須從2個文本框和一個數組中選擇數據,我應該如何創建此對象$ yourServiceMethodsArgumentShapeInstance? –