官方博客
官方博客

百度旋转直接返回tk,ds 接口

https://zblog.kailigw.com/zb_users/upload/2020/04/202004191002549241235.png

打码token 购买地址 https://zfaka.kailigw.com/product/

php curl 代码

<?php


$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "http://106.13.108.81:882/api/Getxztk",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => array('token' => '414b3543a18d5ce2319f1efca707ca53','ak' => '3de47787fd60b30420f868ffbf4dbccd','ua' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0','type' => 'spin'),
));

$response = curl_exec($curl);

curl_close($curl);

echo $response;

C 代码

var client = new RestClient("http://106.13.108.81:882/api/Getxztk");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AlwaysMultipartFormData = true;
request.AddParameter("token", "414b3543a18d5ce2319f1efca707ca53");
request.AddParameter("ak", "3de47787fd60b30420f868ffbf4dbccd");
request.AddParameter("ua", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0");
request.AddParameter("type", "spin");
IRestResponse response = client.Execute(request);

Console.WriteLine(response.Content);

C##  代码

CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
  curl_easy_setopt(curl, CURLOPT_URL, "http://106.13.108.81:882/api/Getxztk");
  curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
  curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
  struct curl_slist *headers = NULL;
  curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
  curl_mime *mime;
  curl_mimepart *part;
  mime = curl_mime_init(curl);
  part = curl_mime_addpart(mime);
  curl_mime_name(part, "token");
  curl_mime_data(part, "414b3543a18d5ce2319f1efca707ca53", CURL_ZERO_TERMINATED);
  part = curl_mime_addpart(mime);
  curl_mime_name(part, "ak");
  curl_mime_data(part, "3de47787fd60b30420f868ffbf4dbccd", CURL_ZERO_TERMINATED);
  part = curl_mime_addpart(mime);
  curl_mime_name(part, "ua");
  curl_mime_data(part, "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0", CURL_ZERO_TERMINATED);
  part = curl_mime_addpart(mime);
  curl_mime_name(part, "type");
  curl_mime_data(part, "spin", CURL_ZERO_TERMINATED);
  curl_easy_setopt(curl, CURLOPT_MIMEPOST, mime);
  res = curl_easy_perform(curl);
  curl_mime_free(mime);
}

curl_easy_cleanup(curl);

java http代码

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("token", "414b3543a18d5ce2319f1efca707ca53")
  .addFormDataPart("ak", "3de47787fd60b30420f868ffbf4dbccd")
  .addFormDataPart("ua", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0")
  .addFormDataPart("type", "spin")
  .build();
Request request = new Request.Builder()
  .url("http://106.13.108.81:882/api/Getxztk")
  .method("POST", body)
  .build();

Response response = client.newCall(request).execute();

Java - Unirest  代码

Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("http://106.13.108.81:882/api/Getxztk")
  .multiPartContent()  .field("token", "414b3543a18d5ce2319f1efca707ca53")
  .field("ak", "3de47787fd60b30420f868ffbf4dbccd")
  .field("ua", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0")
  .field("type", "spin")
  .asString();
2020-04-19 10:20:27
0 热度