Image format, size, colour mode and EXIF basics
Returns an image's format, dimensions, colour mode, file size, animation and EXIF data.
Request
POSThttps://image-tools.p.apihiver.com/v1/info
Upload the image in the file field (max 25 MB). Instead of a file you can send JSON: {"url": "https://…"} for a public image URL, or {"base64": "…"}.
*
No file chosen
File. The image file (JPG, PNG, WebP, GIF, BMP or TIFF).
Parameters and body structure are inherited from this endpoint's definition. Changes here only apply to this test run.
Language
Client
1curl --request POST \
2 --url https://image-tools.p.apihiver.com/v1/info \
3 --header 'Accept: application/json' \
4 --header 'X-API-Key: YOUR_API_KEY' \
5 --header 'content-type: multipart/form-data' \
6 --form file=@file.binImage format, size, colour mode and EXIF basics: Image Tools API reference
Returns an image's format, dimensions, colour mode, file size, animation and EXIF data. This endpoint is part of the Image Tools API: Resize, crop, convert, rotate and compress images, add text watermarks, extract colour palettes and make placeholder images.
Image format, size, colour mode and EXIF basics: example requests in every language
POST /v1/info in Shell (cURL)
curl --request POST \
--url https://image-tools.p.apihiver.com/v1/info \
--header 'Accept: application/json' \
--header 'X-API-Key: YOUR_API_KEY' \
--header 'content-type: multipart/form-data' \
--form [email protected]POST /v1/info in Shell (HTTPie)
echo '-----011000010111000001101001
Content-Disposition: form-data; name="file"; filename="file.bin"
Content-Type: multipart/form-data
-----011000010111000001101001--
' | \
http POST https://image-tools.p.apihiver.com/v1/info \
Accept:application/json \
X-API-Key:YOUR_API_KEY \
content-type:'multipart/form-data; boundary=---011000010111000001101001'POST /v1/info in Shell (Wget)
wget --quiet \
--method POST \
--header 'Accept: application/json' \
--header 'X-API-Key: YOUR_API_KEY' \
--header 'content-type: multipart/form-data; boundary=---011000010111000001101001' \
--body-data '-----011000010111000001101001\r\nContent-Disposition: form-data; name="file"; filename="file.bin"\r\nContent-Type: multipart/form-data\r\n\r\n\r\n-----011000010111000001101001--\r\n' \
--output-document \
- https://image-tools.p.apihiver.com/v1/infoPOST /v1/info in Node.js (http)
const http = require('https');
const options = {
method: 'POST',
hostname: 'image-tools.p.apihiver.com',
port: null,
path: '/v1/info',
headers: {
Accept: 'application/json',
'X-API-Key': 'YOUR_API_KEY',
'content-type': 'multipart/form-data; boundary=---011000010111000001101001'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write('-----011000010111000001101001\r\nContent-Disposition: form-data; name="file"; filename="file.bin"\r\nContent-Type: multipart/form-data\r\n\r\n\r\n-----011000010111000001101001--\r\n');
req.end();POST /v1/info in Node.js (Request)
const fs = require('fs');
const request = require('request');
const options = {
method: 'POST',
url: 'https://image-tools.p.apihiver.com/v1/info',
headers: {
Accept: 'application/json',
'X-API-Key': 'YOUR_API_KEY',
'content-type': 'multipart/form-data; boundary=---011000010111000001101001'
},
formData: {
file: {
value: fs.createReadStream('file.bin'),
options: {filename: 'file.bin', contentType: 'multipart/form-data'}
}
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});POST /v1/info in Node.js (Unirest)
const fs = require('fs');
const unirest = require('unirest');
const req = unirest('POST', 'https://image-tools.p.apihiver.com/v1/info');
req.headers({
Accept: 'application/json',
'X-API-Key': 'YOUR_API_KEY',
'content-type': 'multipart/form-data; boundary=---011000010111000001101001'
});
req.multipart([
{
body: fs.createReadStream('file.bin'),
'content-type': 'multipart/form-data'
}
]);
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});POST /v1/info in Node.js (Axios)
const axios = require('axios').default;
const options = {
method: 'POST',
url: 'https://image-tools.p.apihiver.com/v1/info',
headers: {
Accept: 'application/json',
'X-API-Key': 'YOUR_API_KEY',
'content-type': 'multipart/form-data; boundary=---011000010111000001101001'
},
data: '-----011000010111000001101001\r\nContent-Disposition: form-data; name="file"; filename="file.bin"\r\nContent-Type: multipart/form-data\r\n\r\n\r\n-----011000010111000001101001--\r\n'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}POST /v1/info in Node.js (Fetch)
const fs = require('fs');
const FormData = require('form-data');
const fetch = require('node-fetch');
const formData = new FormData();
formData.append('file', fs.createReadStream('file.bin'));
const url = 'https://image-tools.p.apihiver.com/v1/info';
const options = {
method: 'POST',
headers: {Accept: 'application/json', 'X-API-Key': 'YOUR_API_KEY'}
};
options.body = formData;
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}POST /v1/info in JavaScript (XMLHttpRequest)
const data = new FormData();
data.append('file', 'file.bin');
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', 'https://image-tools.p.apihiver.com/v1/info');
xhr.setRequestHeader('Accept', 'application/json');
xhr.setRequestHeader('X-API-Key', 'YOUR_API_KEY');
xhr.send(data);POST /v1/info in JavaScript (Axios)
import axios from 'axios';
const form = new FormData();
form.append('file', 'file.bin');
const options = {
method: 'POST',
url: 'https://image-tools.p.apihiver.com/v1/info',
headers: {
Accept: 'application/json',
'X-API-Key': 'YOUR_API_KEY',
'content-type': 'multipart/form-data; boundary=---011000010111000001101001'
},
data: '[form]'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}POST /v1/info in JavaScript (Fetch)
const url = 'https://image-tools.p.apihiver.com/v1/info';
const form = new FormData();
form.append('file', 'file.bin');
const options = {
method: 'POST',
headers: {Accept: 'application/json', 'X-API-Key': 'YOUR_API_KEY'}
};
options.body = form;
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}POST /v1/info in JavaScript (jQuery)
const form = new FormData();
form.append('file', 'file.bin');
const settings = {
async: true,
crossDomain: true,
url: 'https://image-tools.p.apihiver.com/v1/info',
method: 'POST',
headers: {
Accept: 'application/json',
'X-API-Key': 'YOUR_API_KEY'
},
processData: false,
contentType: false,
mimeType: 'multipart/form-data',
data: form
};
$.ajax(settings).done(function (response) {
console.log(response);
});POST /v1/info in Python (http.client)
import http.client
conn = http.client.HTTPSConnection("image-tools.p.apihiver.com")
payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"file.bin\"\r\nContent-Type: multipart/form-data\r\n\r\n\r\n-----011000010111000001101001--\r\n"
headers = {
'Accept': "application/json",
'X-API-Key': "YOUR_API_KEY",
'content-type': "multipart/form-data; boundary=---011000010111000001101001"
}
conn.request("POST", "/v1/info", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))POST /v1/info in Python (Requests)
import requests
url = "https://image-tools.p.apihiver.com/v1/info"
files = { "file": "open('file.bin', 'rb')" }
headers = {
"Accept": "application/json",
"X-API-Key": "YOUR_API_KEY"
}
response = requests.post(url, files=files, headers=headers)
print(response.json())POST /v1/info in PHP (cURL)
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://image-tools.p.apihiver.com/v1/info",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"file.bin\"\r\nContent-Type: multipart/form-data\r\n\r\n\r\n-----011000010111000001101001--\r\n",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"X-API-Key: YOUR_API_KEY",
"content-type: multipart/form-data; boundary=---011000010111000001101001"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}POST /v1/info in PHP (Guzzle)
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://image-tools.p.apihiver.com/v1/info', [
'multipart' => [
[
'name' => 'file',
'filename' => 'file.bin',
'contents' => null,
'headers' => [
'Content-Type' => 'multipart/form-data'
]
]
]
'headers' => [
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY',
],
]);
echo $response->getBody();POST /v1/info in PHP (PECL HTTP v1)
<?php
$request = new HttpRequest();
$request->setUrl('https://image-tools.p.apihiver.com/v1/info');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY',
'content-type' => 'multipart/form-data; boundary=---011000010111000001101001'
]);
$request->setBody('-----011000010111000001101001
Content-Disposition: form-data; name="file"; filename="file.bin"
Content-Type: multipart/form-data
-----011000010111000001101001--
');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}POST /v1/info in PHP (PECL HTTP v2)
<?php
$client = new http\Client;
$request = new http\Client\Request;
$body = new http\Message\Body;
$body->addForm(null, [
[
'name' => 'file',
'type' => 'multipart/form-data',
'file' => 'file.bin',
'data' => null
]
]);
$request->setRequestUrl('https://image-tools.p.apihiver.com/v1/info');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();POST /v1/info in Java (AsyncHttp)
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "https://image-tools.p.apihiver.com/v1/info")
.setHeader("Accept", "application/json")
.setHeader("X-API-Key", "YOUR_API_KEY")
.setHeader("content-type", "multipart/form-data; boundary=---011000010111000001101001")
.setBody("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"file.bin\"\r\nContent-Type: multipart/form-data\r\n\r\n\r\n-----011000010111000001101001--\r\n")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();POST /v1/info in Java (java.net.http)
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://image-tools.p.apihiver.com/v1/info"))
.header("Accept", "application/json")
.header("X-API-Key", "YOUR_API_KEY")
.header("content-type", "multipart/form-data; boundary=---011000010111000001101001")
.method("POST", HttpRequest.BodyPublishers.ofString("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"file.bin\"\r\nContent-Type: multipart/form-data\r\n\r\n\r\n-----011000010111000001101001--\r\n"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());POST /v1/info in Java (OkHttp)
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("multipart/form-data; boundary=---011000010111000001101001");
RequestBody body = RequestBody.create(mediaType, "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"file.bin\"\r\nContent-Type: multipart/form-data\r\n\r\n\r\n-----011000010111000001101001--\r\n");
Request request = new Request.Builder()
.url("https://image-tools.p.apihiver.com/v1/info")
.post(body)
.addHeader("Accept", "application/json")
.addHeader("X-API-Key", "YOUR_API_KEY")
.addHeader("content-type", "multipart/form-data; boundary=---011000010111000001101001")
.build();
Response response = client.newCall(request).execute();POST /v1/info in Java (Unirest)
HttpResponse<String> response = Unirest.post("https://image-tools.p.apihiver.com/v1/info")
.header("Accept", "application/json")
.header("X-API-Key", "YOUR_API_KEY")
.header("content-type", "multipart/form-data; boundary=---011000010111000001101001")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"file.bin\"\r\nContent-Type: multipart/form-data\r\n\r\n\r\n-----011000010111000001101001--\r\n")
.asString();POST /v1/info in C# (HttpClient)
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("https://image-tools.p.apihiver.com/v1/info"),
Headers =
{
{ "Accept", "application/json" },
{ "X-API-Key", "YOUR_API_KEY" },
},
Content = new MultipartFormDataContent
{
new StringContent("")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("multipart/form-data"),
ContentDisposition = new ContentDispositionHeaderValue("form-data")
{
Name = "file",
FileName = "file.bin",
}
}
},
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}POST /v1/info in C# (RestSharp)
var client = new RestClient("https://image-tools.p.apihiver.com/v1/info");
var request = new RestRequest("", Method.Post);
request.AddHeader("Accept", "application/json");
request.AddHeader("X-API-Key", "YOUR_API_KEY");
request.AddHeader("content-type", "multipart/form-data; boundary=---011000010111000001101001");
request.AddParameter("multipart/form-data; boundary=---011000010111000001101001", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"file.bin\"\r\nContent-Type: multipart/form-data\r\n\r\n\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
var response = client.Execute(request);POST /v1/info in Go (NewRequest)
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://image-tools.p.apihiver.com/v1/info"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"file.bin\"\r\nContent-Type: multipart/form-data\r\n\r\n\r\n-----011000010111000001101001--\r\n")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Accept", "application/json")
req.Header.Add("X-API-Key", "YOUR_API_KEY")
req.Header.Add("content-type", "multipart/form-data; boundary=---011000010111000001101001")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}POST /v1/info in Ruby (net::http)
require 'uri'
require 'net/http'
url = URI("https://image-tools.p.apihiver.com/v1/info")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Accept"] = 'application/json'
request["X-API-Key"] = 'YOUR_API_KEY'
request["content-type"] = 'multipart/form-data; boundary=---011000010111000001101001'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"file.bin\"\r\nContent-Type: multipart/form-data\r\n\r\n\r\n-----011000010111000001101001--\r\n"
response = http.request(request)
puts response.read_bodyPOST /v1/info in Swift (NSURLSession)
import Foundation
let headers = [
"Accept": "application/json",
"X-API-Key": "YOUR_API_KEY",
"content-type": "multipart/form-data; boundary=---011000010111000001101001"
]
let parameters = [
[
"name": "file",
"fileName": "file.bin",
"contentType": "multipart/form-data"
]
]
let boundary = "---011000010111000001101001"
var body = ""
var error: NSError? = nil
for param in parameters {
let paramName = param["name"]!
body += "--\(boundary)\r\n"
body += "Content-Disposition:form-data; name=\"\(paramName)\""
if let filename = param["fileName"] {
let contentType = param["content-type"]!
let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)
if (error != nil) {
print(error as Any)
}
body += "; filename=\"\(filename)\"\r\n"
body += "Content-Type: \(contentType)\r\n\r\n"
body += fileContent
} else if let paramValue = param["value"] {
body += "\r\n\r\n\(paramValue)"
}
}
let request = NSMutableURLRequest(url: NSURL(string: "https://image-tools.p.apihiver.com/v1/info")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()POST /v1/info in Objective-C (NSURLSession)
#import <Foundation/Foundation.h>
NSDictionary *headers = @{ @"Accept": @"application/json",
@"X-API-Key": @"YOUR_API_KEY",
@"content-type": @"multipart/form-data; boundary=---011000010111000001101001" };
NSArray *parameters = @[ @{ @"name": @"file", @"fileName": @"file.bin", @"contentType": @"multipart/form-data" } ];
NSString *boundary = @"---011000010111000001101001";
NSError *error;
NSMutableString *body = [NSMutableString string];
for (NSDictionary *param in parameters) {
[body appendFormat:@"--%@\r\n", boundary];
if (param[@"fileName"]) {
[body appendFormat:@"Content-Disposition:form-data; name=\"%@\"; filename=\"%@\"\r\n", param[@"name"], param[@"fileName"]];
[body appendFormat:@"Content-Type: %@\r\n\r\n", param[@"contentType"]];
[body appendFormat:@"%@", [NSString stringWithContentsOfFile:param[@"fileName"] encoding:NSUTF8StringEncoding error:&error]];
if (error) {
NSLog(@"%@", error);
}
} else {
[body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
[body appendFormat:@"%@", param[@"value"]];
}
}
[body appendFormat:@"\r\n--%@--\r\n", boundary];
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://image-tools.p.apihiver.com/v1/info"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
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];POST /v1/info in Kotlin (OkHttp)
val client = OkHttpClient()
val mediaType = MediaType.parse("multipart/form-data; boundary=---011000010111000001101001")
val body = RequestBody.create(mediaType, "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"file.bin\"\r\nContent-Type: multipart/form-data\r\n\r\n\r\n-----011000010111000001101001--\r\n")
val request = Request.Builder()
.url("https://image-tools.p.apihiver.com/v1/info")
.post(body)
.addHeader("Accept", "application/json")
.addHeader("X-API-Key", "YOUR_API_KEY")
.addHeader("content-type", "multipart/form-data; boundary=---011000010111000001101001")
.build()
val response = client.newCall(request).execute()POST /v1/info in C (libcurl)
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "https://image-tools.p.apihiver.com/v1/info");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Accept: application/json");
headers = curl_slist_append(headers, "X-API-Key: YOUR_API_KEY");
headers = curl_slist_append(headers, "content-type: multipart/form-data; boundary=---011000010111000001101001");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"file.bin\"\r\nContent-Type: multipart/form-data\r\n\r\n\r\n-----011000010111000001101001--\r\n");
CURLcode ret = curl_easy_perform(hnd);POST /v1/info in Clojure (clj-http)
(require '[clj-http.client :as client])
(client/post "https://image-tools.p.apihiver.com/v1/info" {:headers {:X-API-Key "YOUR_API_KEY"}
:multipart [{:name "file"
:content (clojure.java.io/file "file.bin")}]
:accept :json})POST /v1/info in OCaml (CoHTTP)
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "https://image-tools.p.apihiver.com/v1/info" in
let headers = Header.add_list (Header.init ()) [
("Accept", "application/json");
("X-API-Key", "YOUR_API_KEY");
("content-type", "multipart/form-data; boundary=---011000010111000001101001");
] in
let body = Cohttp_lwt_body.of_string "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"file.bin\"\r\nContent-Type: multipart/form-data\r\n\r\n\r\n-----011000010111000001101001--\r\n" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)POST /v1/info in R (httr)
library(httr)
url <- "https://image-tools.p.apihiver.com/v1/info"
payload <- "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"file.bin\"\r\nContent-Type: multipart/form-data\r\n\r\n\r\n-----011000010111000001101001--\r\n"
encode <- "multipart"
response <- VERB("POST", url, body = payload, add_headers('X-API-Key' = 'YOUR_API_KEY'), content_type("multipart/form-data"), accept("application/json"), encode = encode)
content(response, "text")POST /v1/info in PowerShell (Invoke-WebRequest)
$headers=@{}
$headers.Add("Accept", "application/json")
$headers.Add("X-API-Key", "YOUR_API_KEY")
$headers.Add("content-type", "multipart/form-data; boundary=---011000010111000001101001")
$response = Invoke-WebRequest -Uri 'https://image-tools.p.apihiver.com/v1/info' -Method POST -Headers $headers -ContentType 'multipart/form-data; boundary=---011000010111000001101001' -Body '-----011000010111000001101001
Content-Disposition: form-data; name="file"; filename="file.bin"
Content-Type: multipart/form-data
-----011000010111000001101001--
'POST /v1/info in PowerShell (Invoke-RestMethod)
$headers=@{}
$headers.Add("Accept", "application/json")
$headers.Add("X-API-Key", "YOUR_API_KEY")
$headers.Add("content-type", "multipart/form-data; boundary=---011000010111000001101001")
$response = Invoke-RestMethod -Uri 'https://image-tools.p.apihiver.com/v1/info' -Method POST -Headers $headers -ContentType 'multipart/form-data; boundary=---011000010111000001101001' -Body '-----011000010111000001101001
Content-Disposition: form-data; name="file"; filename="file.bin"
Content-Type: multipart/form-data
-----011000010111000001101001--
'POST /v1/info in HTTP (HTTP/1.1)
POST /v1/info HTTP/1.1
Accept: application/json
X-Api-Key: YOUR_API_KEY
Content-Type: multipart/form-data; boundary=---011000010111000001101001
Host: image-tools.p.apihiver.com
Content-Length: 169
-----011000010111000001101001
Content-Disposition: form-data; name="file"; filename="file.bin"
Content-Type: multipart/form-data
-----011000010111000001101001--
Example response (200, application/json)
Success.
1{
2 "exif": {},
3 "mode": "RGB",
4 "width": 900,
5 "format": "PNG",
6 "frames": 1,
7 "height": 300,
8 "animated": false,
9 "file_size_bytes": 18451,
10 "has_transparency": false
11}Errors
- 400 — A required parameter is missing or a value has the wrong format.
1{ 2 "error": { 3 "code": "INVALID_INPUT", 4 "message": "Provide a file upload, 'url', or 'base64'." 5 } 6}
Gateway errors (missing key, no subscription, rate limits) are listed in Error codes.