Copy to Clipboard <?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.replier.net/sendPTT?token=%7B%7Btoken%7D%7D&instanceid=%7B%7Binstancid%7D%7D",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Copy to Clipboard <?php
$request = new HttpRequest();
$request->setUrl('https://www.replier.net/sendPTT');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData(array(
'token' => '{{token}}',
'instanceid' => '{{instancid}}'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
Copy to Clipboard var client = new RestClient("https://www.replier.net/sendPTT?token=%7B%7Btoken%7D%7D&instanceid=%7B%7Binstancid%7D%7D");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
Copy to Clipboard var unirest = require("unirest");
var req = unirest("GET", "https://www.replier.net/sendPTT");
req.query({
"token": "{{token}}",
"instanceid": "{{instancid}}"
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
Copy to Clipboard var request = require("request");
var options = {
method: 'GET',
url: 'https://www.replier.net/sendPTT',
qs: {token: '{{token}}', instanceid: '{{instancid}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
Copy to Clipboard HttpResponse<String> response = Unirest.get("https://www.replier.net/sendPTT?token=%7B%7Btoken%7D%7D&instanceid=%7B%7Binstancid%7D%7D")
.asString();
Copy to Clipboard OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://www.replier.net/sendPTT?token=%7B%7Btoken%7D%7D&instanceid=%7B%7Binstancid%7D%7D")
.get()
.build();
Response response = client.newCall(request).execute();
Copy to Clipboard #import <Foundation/Foundation.h>
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://www.replier.net/sendPTT?token=%7B%7Btoken%7D%7D&instanceid=%7B%7Binstancid%7D%7D"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
Copy to Clipboard curl --request GET \
--url 'https://www.replier.net/sendPTT?token=%7B%7Btoken%7D%7D&instanceid=%7B%7Binstancid%7D%7D'
Copy to Clipboard import requests
url = "https://www.replier.net/sendPTT"
querystring = {"token":"{{token}}","instanceid":"{{instancid}}"}
response = requests.request("GET", url, params=querystring)
print(response.text)
Copy to Clipboard import http.client
conn = http.client.HTTPSConnection("www.replier.net")
conn.request("GET", "/sendPTT?token=%7B%7Btoken%7D%7D&instanceid=%7B%7Binstancid%7D%7D")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Copy to Clipboard require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://www.replier.net/sendPTT?token=%7B%7Btoken%7D%7D&instanceid=%7B%7Binstancid%7D%7D")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
Copy to Clipboard var settings = {
"async": true,
"crossDomain": true,
"url": "https://www.replier.net/sendPTT?token=%7B%7Btoken%7D%7D&instanceid=%7B%7Binstancid%7D%7D",
"method": "GET",
"headers": {}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
Copy to Clipboard fetch("https://www.replier.net/sendPTT?token=%7B%7Btoken%7D%7D&instanceid=%7B%7Binstancid%7D%7D", {
"method": "GET",
"headers": {}
})
.then(response => {
console.log(response);
})
.catch(err => {
console.log(err);
});
Copy to Clipboard import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "https://www.replier.net/sendPTT?token=%7B%7Btoken%7D%7D&instanceid=%7B%7Binstancid%7D%7D")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()