curl --location --request POST 'https://api.gugudata.com/imagerecognition/html2pdf?appkey=YOUR_APPKEY' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'type=YOUR_VALUE' \
--data-urlencode 'content=YOUR_VALUE' \
--data-urlencode 'landscape=0' \
--data-urlencode 'showpages=0' \
--data-urlencode 'filename=N/A'
#include <curl/curl.h>
int main(void) {
CURL *curl = curl_easy_init();
if (curl) {
curl_easy_setopt(curl, CURLOPT_URL, "https://api.gugudata.com/imagerecognition/html2pdf?appkey=YOUR_APPKEY");
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Content-Type: application/x-www-form-urlencoded");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "type=YOUR_VALUE&content=YOUR_VALUE&landscape=0&showpages=0&filename=N%2fA");
CURLcode res = curl_easy_perform(curl);
(void)res;
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
}
return 0;
}
using System;
using System.Collections.Generic;
using System.IO;
using System.Net.Http;
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.gugudata.com/imagerecognition/html2pdf?appkey=YOUR_APPKEY");
request.Content = new FormUrlEncodedContent(new Dictionary<string, string>
{
{ "type", "YOUR_VALUE" },
{ "content", "YOUR_VALUE" },
{ "landscape", "0" },
{ "showpages", "0" },
{ "filename", "N/A" }
});
var response = client.SendAsync(request).Result;
Console.WriteLine(response.Content.ReadAsStringAsync().Result);
package main
import (
"strings"
"fmt"
"io"
"net/http"
)
func main() {
url := "https://api.gugudata.com/imagerecognition/html2pdf?appkey=YOUR_APPKEY"
payload := strings.NewReader("type=YOUR_VALUE&content=YOUR_VALUE&landscape=0&showpages=0&filename=N%2fA")
req, err := http.NewRequest("POST", url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, err := http.DefaultClient.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "type=YOUR_VALUE&content=YOUR_VALUE&landscape=0&showpages=0&filename=N%2fA");
Request request = new Request.Builder()
.url("https://api.gugudata.com/imagerecognition/html2pdf?appkey=YOUR_APPKEY")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
$.ajax({
url: "https://api.gugudata.com/imagerecognition/html2pdf?appkey=YOUR_APPKEY",
method: "POST",
data: { "type": "YOUR_VALUE", "content": "YOUR_VALUE", "landscape": "0", "showpages": "0", "filename": "N/A" },
}).done(function (response) {
console.log(response);
});
const response = await fetch("https://api.gugudata.com/imagerecognition/html2pdf?appkey=YOUR_APPKEY", {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: new URLSearchParams({ "type": "YOUR_VALUE", "content": "YOUR_VALUE", "landscape": "0", "showpages": "0", "filename": "N/A" })
});
console.log(await response.text());
const response = await fetch("https://api.gugudata.com/imagerecognition/html2pdf?appkey=YOUR_APPKEY", {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: new URLSearchParams({ "type": "YOUR_VALUE", "content": "YOUR_VALUE", "landscape": "0", "showpages": "0", "filename": "N/A" })
});
console.log(await response.text());
#import <Foundation/Foundation.h>
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.gugudata.com/imagerecognition/html2pdf?appkey=YOUR_APPKEY"]];
[request setHTTPMethod:@"POST"];
NSString *body = @"type=YOUR_VALUE&content=YOUR_VALUE&landscape=0&showpages=0&filename=N%2fA";
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
[request setHTTPBody:[body dataUsingEncoding:NSUTF8StringEncoding]];
NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
return;
}
NSLog(@"%@", [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]);
}];
[task resume];
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.gugudata.com/imagerecognition/html2pdf?appkey=YOUR_APPKEY",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "type=YOUR_VALUE&content=YOUR_VALUE&landscape=0&showpages=0&filename=N%2fA",
CURLOPT_HTTPHEADER => array("Content-Type: application/x-www-form-urlencoded"),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "https://api.gugudata.com/imagerecognition/html2pdf?appkey=YOUR_APPKEY"
payload = { "type": "YOUR_VALUE", "content": "YOUR_VALUE", "landscape": "0", "showpages": "0", "filename": "N/A" }
response = requests.post(url, data=payload)
print(response.text)
require "uri"
require "net/http"
url = URI("https://api.gugudata.com/imagerecognition/html2pdf?appkey=YOUR_APPKEY")
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 = "type=YOUR_VALUE&content=YOUR_VALUE&landscape=0&showpages=0&filename=N%2fA"
response = https.request(request)
puts response.read_body
import Foundation
let semaphore = DispatchSemaphore(value: 0)
var request = URLRequest(url: URL(string: "https://api.gugudata.com/imagerecognition/html2pdf?appkey=YOUR_APPKEY")!, timeoutInterval: .infinity)
request.httpMethod = "POST"
request.addValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
request.httpBody = "type=YOUR_VALUE&content=YOUR_VALUE&landscape=0&showpages=0&filename=N%2fA".data(using: .utf8)
let task = URLSession.shared.dataTask(with: request) { data, response, error in
defer { semaphore.signal() }
guard let data = data else {
print(String(describing: error))
return
}
print(String(data: data, encoding: .utf8)!)
}
task.resume()
semaphore.wait()