curl --location --request POST 'https://api.gugudata.com/news/fetchcontentimages' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'appkey=YOUR_APPKEY' \
--data-urlencode 'url=YOUR_VALUE' \
--data-urlencode 'limittype=YOUR_VALUE' \
--data-urlencode 'limitvalue=YOUR_VALUE' \
--data-urlencode 'imagewithtag=false' \
--data-urlencode 'htmlsourcecontent=false'
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_URL, "https://api.gugudata.com/news/fetchcontentimages");
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Content-Type: application/x-www-form-urlencoded");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
const char *data = "appkey=YOUR_APPKEY&url=YOUR_VALUE&limittype=YOUR_VALUE&limitvalue=YOUR_VALUE&imagewithtag=false&htmlsourcecontent=false";
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/x-www-form-urlencoded");
var urlencoded = new URLSearchParams();
urlencoded.append("appkey", "YOUR_APPKEY");
urlencoded.append("url", "YOUR_VALUE");
urlencoded.append("limittype", "YOUR_VALUE");
urlencoded.append("limitvalue", "YOUR_VALUE");
urlencoded.append("imagewithtag", "false");
urlencoded.append("htmlsourcecontent", "false");
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: urlencoded,
redirect: 'follow'
};
fetch("https://api.gugudata.com/news/fetchcontentimages", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
var client = new RestClient("https://api.gugudata.com/news/fetchcontentimages");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("appkey", "YOUR_APPKEY");
request.AddParameter("url", "YOUR_VALUE");
request.AddParameter("limittype", "YOUR_VALUE");
request.AddParameter("limitvalue", "YOUR_VALUE");
request.AddParameter("imagewithtag", "false");
request.AddParameter("htmlsourcecontent", "false");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.gugudata.com/news/fetchcontentimages"
method := "POST"
payload := strings.NewReader("appkey=YOUR_APPKEY&url=YOUR_VALUE&limittype=YOUR_VALUE&limitvalue=YOUR_VALUE&imagewithtag=false&htmlsourcecontent=false")
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
}
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, err := client.Do(req)
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
fmt.Println(string(body))
}
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "appkey=YOUR_APPKEY&url=YOUR_VALUE&limittype=YOUR_VALUE&limitvalue=YOUR_VALUE&imagewithtag=false&htmlsourcecontent=false");
Request request = new Request.Builder()
.url("https://api.gugudata.com/news/fetchcontentimages")
.method("POST", body)
.addHeader("Content-Type", "application/x-www-form-urlencoded")
.build();
Response response = client.newCall(request).execute();
var settings = {
"url": "https://api.gugudata.com/news/fetchcontentimages",
"method": "POST",
"timeout": 0,
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
"data": {
"appkey":'YOUR_APPKEY',
"url":'YOUR_VALUE',
"limittype":'YOUR_VALUE',
"limitvalue":YOUR_VALUE,
"imagewithtag":false,
"htmlsourcecontent":false
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
#import <Foundation/Foundation.h>
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.gugudata.com/news/fetchcontentimages"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
NSDictionary *headers = @{
@"Content-Type": @"application/x-www-form-urlencoded"
};
[request setAllHTTPHeaderFields:headers];
NSMutableData *postData =
[[NSMutableData alloc] initWithData:[@"appkey=YOUR_APPKEY" dataUsingEncoding:NSUTF8StringEncoding]];[postData appendData:[@"&url=YOUR_VALUE" dataUsingEncoding:NSUTF8StringEncoding]];[postData appendData:[@"&limittype=YOUR_VALUE" dataUsingEncoding:NSUTF8StringEncoding]];[postData appendData:[@"&limitvalue=YOUR_VALUE" dataUsingEncoding:NSUTF8StringEncoding]];[postData appendData:[@"&imagewithtag=false" dataUsingEncoding:NSUTF8StringEncoding]];[postData appendData:[@"&htmlsourcecontent=false" dataUsingEncoding:NSUTF8StringEncoding]];
[request setHTTPBody:postData];
[request setHTTPMethod:@"POST"];
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;
NSError *parseError = nil;
NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
NSLog(@"%@",responseDictionary);
dispatch_semaphore_signal(sema);
}
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
import requests
url = "https://api.gugudata.com/news/fetchcontentimages"
payload = 'appkey=YOUR_APPKEY&url=YOUR_VALUE&limittype=YOUR_VALUE&limitvalue=YOUR_VALUE&imagewithtag=false&htmlsourcecontent=false'
headers = {
'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data = payload)
print(response.text)
require "uri"
require "net/http"
url = URI("https://api.gugudata.com/news/fetchcontentimages")
https = Net::HTTP.new(url.host, url.port);
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/x-www-form-urlencoded"
request.body = "appkey=YOUR_APPKEY&url=YOUR_VALUE&limittype=YOUR_VALUE&limitvalue=YOUR_VALUE&imagewithtag=false&htmlsourcecontent=false"
response = https.request(request)
puts response.read_body
import Foundation
var semaphore = DispatchSemaphore (value: 0)
let parameters = "appkey=YOUR_APPKEY&url=YOUR_VALUE&limittype=YOUR_VALUE&limitvalue=YOUR_VALUE&imagewithtag=false&htmlsourcecontent=false"
let postData = parameters.data(using: .utf8)
var request = URLRequest(url: URL(string: "https://api.gugudata.com/news/fetchcontentimages")!,timeoutInterval: Double.infinity)
request.addValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
request.httpMethod = "POST"
request.httpBody = postData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
return
}
print(String(data: data, encoding: .utf8)!)
semaphore.signal()
}
task.resume()
semaphore.wait()
/*!
{ %>/*!
* GuGuData API Request Node.js Demo
* 咕咕数据 API Node.js 请求 DEMO
* 咕咕数据,专业的数据提供商,提供全面的数据接口 API,并提供专业全面的数据接口、商业数据分析。
* 让数据成为您的生产原料。
* https://www.gugudata.com
*/
/* 咕咕数据 API 请求 DEMO ***开始***/
// 导入相关类库
var request = require("request");
var api_host = "https://api.gugudata.com";
var api_path = "/news/fetchcontentimages"; // todo: 注意修改请求对应的 API 接口
// todo: 注意修改构造请求参数
var data = {
appkey:'YOUR_APPKEY', url:'YOUR_VALUE', limittype:'YOUR_VALUE', limitvalue:YOUR_VALUE, imagewithtag:false, htmlsourcecontent:false
};
var options = {
'method': "POST",
'url': api_host + api_path,
'headers': {
'Content-Type': 'application/x-www-form-urlencoded'
},
form: data
};
// 发送网络请求
var requestGuGuData = request(options, (error, response) => {
if (error) throw new Error(error);
console.log("********接口响应返回 JSON 数据********");
console.log(JSON.parse(response.body));
requestGuGuData.end();
console.log("********接口响应结束********");
});
/* 咕咕数据 API 请求 DEMO ***结束***/
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.gugudata.com/news/fetchcontentimages",
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 => "appkey=YOUR_APPKEY&url=YOUR_VALUE&limittype=YOUR_VALUE&limitvalue=YOUR_VALUE&imagewithtag=false&htmlsourcecontent=false",
CURLOPT_HTTPHEADER => array(
"Content-Type: application/x-www-form-urlencoded"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;