复制 curl --request GET \
--url 'http://www.zhipaiwu.cn/index.php/Request/telephone?number=6810888&step=1&appcode=e72ce895a25127fbf60f4c482d8d7233492d3a92'
复制 var http = require("http");
var options = {
"method": "GET",
"hostname": "www.zhipaiwu.cn",
"port": null,
"path": "/index.php/Request/telephone?number=6810888&step=1&appcode=e72ce895a25127fbf60f4c482d8d7233492d3a92",
"headers": {}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
复制 HttpResponse response = Unirest.get("http://www.zhipaiwu.cn/index.php/Request/telephone?number=6810888&step=1&appcode=e72ce895a25127fbf60f4c482d8d7233492d3a92")
.asString();
复制
import requests
url = "http://www.zhipaiwu.cn/index.php/Request/telephone?number=6810888&step=1&appcode=e72ce895a25127fbf60f4c482d8d7233492d3a92"
response = requests.request("GET", url)
print(response.text)
复制
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "http://www.zhipaiwu.cn/index.php/Request/telephone?number=6810888&step=1&appcode=e72ce895a25127fbf60f4c482d8d7233492d3a92",
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;
}
复制
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://www.zhipaiwu.cn/index.php/Request/telephone?number=6810888&step=1&appcode=e72ce895a25127fbf60f4c482d8d7233492d3a92"]
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];
复制 require 'uri'
require 'net/http'
url = URI("http://www.zhipaiwu.cn/api.php/Haoma/Telephone")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
复制 #import <Foundation/Foundation.h>
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://apis.zhipaiwu.cn/efficient/vinservice?vin=LSGPC52U6AF102554&key=your_AppKey"]
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];
复制 package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "http://apis.zhipaiwu.cn/efficient/vinservice?vin=LSGPC52U6AF102554&key=your_AppKey"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
复制 import Foundation
var request = NSMutableURLRequest(URL: NSURL(string: "http://apis.zhipaiwu.cn/efficient/vinservice?vin=LSGPC52U6AF102554&key=your_AppKey")!,
cachePolicy: .UseProtocolCachePolicy,
timeoutInterval: 10.0)
request.HTTPMethod = "GET"
let session = NSURLSession.sharedSession()
let dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
println(error)
} else {
let httpResponse = response as? NSHTTPURLResponse
println(httpResponse)
}
})
dataTask.resume()
复制 var settings = {
"async": true,
"crossDomain": true,
"url": "http://apis.zhipaiwu.cn/efficient/vinservice?vin=LSGPC52U6AF102554&key=your_AppKey",
"method": "GET",
"headers": {}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
复制 var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "http://apis.zhipaiwu.cn/efficient/vinservice?vin=LSGPC52U6AF102554&key=your_AppKey");
xhr.send(data);
复制 var client = new RestClient("http://apis.zhipaiwu.cn/efficient/vinservice?vin=LSGPC52U6AF102554&key=your_AppKey");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
复制 open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "http://apis.zhipaiwu.cn/efficient/vinservice?vin=LSGPC52U6AF102554&key=your_AppKey" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
复制 CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "http://apis.zhipaiwu.cn/efficient/vinservice?vin=LSGPC52U6AF102554&key=your_AppKey");
CURLcode ret = curl_easy_perform(hnd);