CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "https://api.print.io/api/v/5/source/api/productpreview/?recipeid=f255af6f-9614-4fe2-aa8b-1b77b936d9d6");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\"SKU\":\"Mug-11oz\",\"Template\":\"Single\",\"Images\":[{\"LayerId\":\"9A5BD\",\"Image\":{\"Url\":\"http://app-imgs.print.io/temp/4a6d6997-347e-44a1-aef7-63f3bdc0f8b3-test092214b.jpg\",\"MaxFit\":\"true\",\"X1\":677,\"X2\":3152,\"Y1\":72,\"Y2\":1227}}]}");

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/post "https://api.print.io/api/v/5/source/api/productpreview/" {:query-params {:recipeid "f255af6f-9614-4fe2-aa8b-1b77b936d9d6"}
                                                                        :content-type :json
                                                                        :form-params {:SKU "Mug-11oz"
                                                                                      :Template "Single"
                                                                                      :Images [{:LayerId "9A5BD"
                                                                                                :Image {:Url "http://app-imgs.print.io/temp/4a6d6997-347e-44a1-aef7-63f3bdc0f8b3-test092214b.jpg"
                                                                                                        :MaxFit "true"
                                                                                                        :X1 677
                                                                                                        :X2 3152
                                                                                                        :Y1 72
                                                                                                        :Y2 1227}}]}})
var client = new RestClient("https://api.print.io/api/v/5/source/api/productpreview/?recipeid=f255af6f-9614-4fe2-aa8b-1b77b936d9d6");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/json");
request.AddParameter("undefined", "{\"SKU\":\"Mug-11oz\",\"Template\":\"Single\",\"Images\":[{\"LayerId\":\"9A5BD\",\"Image\":{\"Url\":\"http://app-imgs.print.io/temp/4a6d6997-347e-44a1-aef7-63f3bdc0f8b3-test092214b.jpg\",\"MaxFit\":\"true\",\"X1\":677,\"X2\":3152,\"Y1\":72,\"Y2\":1227}}]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.print.io/api/v/5/source/api/productpreview/?recipeid=f255af6f-9614-4fe2-aa8b-1b77b936d9d6"

	payload := strings.NewReader("{\"SKU\":\"Mug-11oz\",\"Template\":\"Single\",\"Images\":[{\"LayerId\":\"9A5BD\",\"Image\":{\"Url\":\"http://app-imgs.print.io/temp/4a6d6997-347e-44a1-aef7-63f3bdc0f8b3-test092214b.jpg\",\"MaxFit\":\"true\",\"X1\":677,\"X2\":3152,\"Y1\":72,\"Y2\":1227}}]}")

	req, _ := http.NewRequest("POST", url, payload)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
POST /api/v/5/source/api/productpreview/?recipeid=f255af6f-9614-4fe2-aa8b-1b77b936d9d6 HTTP/1.1
Host: api.print.io
Content-Length: 223

{"SKU":"Mug-11oz","Template":"Single","Images":[{"LayerId":"9A5BD","Image":{"Url":"http://app-imgs.print.io/temp/4a6d6997-347e-44a1-aef7-63f3bdc0f8b3-test092214b.jpg","MaxFit":"true","X1":677,"X2":3152,"Y1":72,"Y2":1227}}]}
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"SKU\":\"Mug-11oz\",\"Template\":\"Single\",\"Images\":[{\"LayerId\":\"9A5BD\",\"Image\":{\"Url\":\"http://app-imgs.print.io/temp/4a6d6997-347e-44a1-aef7-63f3bdc0f8b3-test092214b.jpg\",\"MaxFit\":\"true\",\"X1\":677,\"X2\":3152,\"Y1\":72,\"Y2\":1227}}]}");
Request request = new Request.Builder()
  .url("https://api.print.io/api/v/5/source/api/productpreview/?recipeid=f255af6f-9614-4fe2-aa8b-1b77b936d9d6")
  .post(body)
  .build();

Response response = client.newCall(request).execute();
HttpResponse<String> response = Unirest.post("https://api.print.io/api/v/5/source/api/productpreview/?recipeid=f255af6f-9614-4fe2-aa8b-1b77b936d9d6")
  .body("{\"SKU\":\"Mug-11oz\",\"Template\":\"Single\",\"Images\":[{\"LayerId\":\"9A5BD\",\"Image\":{\"Url\":\"http://app-imgs.print.io/temp/4a6d6997-347e-44a1-aef7-63f3bdc0f8b3-test092214b.jpg\",\"MaxFit\":\"true\",\"X1\":677,\"X2\":3152,\"Y1\":72,\"Y2\":1227}}]}")
  .asString();
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.print.io/api/v/5/source/api/productpreview/?recipeid=f255af6f-9614-4fe2-aa8b-1b77b936d9d6",
  "method": "POST",
  "headers": {},
  "processData": false,
  "data": "{\"SKU\":\"Mug-11oz\",\"Template\":\"Single\",\"Images\":[{\"LayerId\":\"9A5BD\",\"Image\":{\"Url\":\"http://app-imgs.print.io/temp/4a6d6997-347e-44a1-aef7-63f3bdc0f8b3-test092214b.jpg\",\"MaxFit\":\"true\",\"X1\":677,\"X2\":3152,\"Y1\":72,\"Y2\":1227}}]}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
fetch("https://api.print.io/api/v/5/source/api/productpreview/?recipeid=f255af6f-9614-4fe2-aa8b-1b77b936d9d6", {
  "method": "POST",
  "headers": {},
  "body": {
    "SKU": "Mug-11oz",
    "Template": "Single",
    "Images": [
      {
        "LayerId": "9A5BD",
        "Image": {
          "Url": "http://app-imgs.print.io/temp/4a6d6997-347e-44a1-aef7-63f3bdc0f8b3-test092214b.jpg",
          "MaxFit": "true",
          "X1": 677,
          "X2": 3152,
          "Y1": 72,
          "Y2": 1227
        }
      }
    ]
  }
})
.then(response => {
  console.log(response);
})
.catch(err => {
  console.log(err);
});
var data = JSON.stringify({
  "SKU": "Mug-11oz",
  "Template": "Single",
  "Images": [
    {
      "LayerId": "9A5BD",
      "Image": {
        "Url": "http://app-imgs.print.io/temp/4a6d6997-347e-44a1-aef7-63f3bdc0f8b3-test092214b.jpg",
        "MaxFit": "true",
        "X1": 677,
        "X2": 3152,
        "Y1": 72,
        "Y2": 1227
      }
    }
  ]
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.print.io/api/v/5/source/api/productpreview/?recipeid=f255af6f-9614-4fe2-aa8b-1b77b936d9d6");

xhr.send(data);
var http = require("https");

var options = {
  "method": "POST",
  "hostname": "api.print.io",
  "port": null,
  "path": "/api/v/5/source/api/productpreview/?recipeid=f255af6f-9614-4fe2-aa8b-1b77b936d9d6",
  "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.write(JSON.stringify({
  SKU: 'Mug-11oz',
  Template: 'Single',
  Images: [
    {
      LayerId: '9A5BD',
      Image: {
        Url: 'http://app-imgs.print.io/temp/4a6d6997-347e-44a1-aef7-63f3bdc0f8b3-test092214b.jpg',
        MaxFit: 'true',
        X1: 677,
        X2: 3152,
        Y1: 72,
        Y2: 1227
      }
    }
  ]
}));
req.end();
var request = require("request");

var options = {
  method: 'POST',
  url: 'https://api.print.io/api/v/5/source/api/productpreview/',
  qs: {recipeid: 'f255af6f-9614-4fe2-aa8b-1b77b936d9d6'},
  headers: {'content-type': 'application/json'},
  body: {
    SKU: 'Mug-11oz',
    Template: 'Single',
    Images: [
      {
        LayerId: '9A5BD',
        Image: {
          Url: 'http://app-imgs.print.io/temp/4a6d6997-347e-44a1-aef7-63f3bdc0f8b3-test092214b.jpg',
          MaxFit: 'true',
          X1: 677,
          X2: 3152,
          Y1: 72,
          Y2: 1227
        }
      }
    ]
  },
  json: true
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
var unirest = require("unirest");

var req = unirest("POST", "https://api.print.io/api/v/5/source/api/productpreview/");

req.query({
  "recipeid": "f255af6f-9614-4fe2-aa8b-1b77b936d9d6"
});

req.headers({
  "content-type": "application/json"
});

req.type("json");
req.send({
  "SKU": "Mug-11oz",
  "Template": "Single",
  "Images": [
    {
      "LayerId": "9A5BD",
      "Image": {
        "Url": "http://app-imgs.print.io/temp/4a6d6997-347e-44a1-aef7-63f3bdc0f8b3-test092214b.jpg",
        "MaxFit": "true",
        "X1": 677,
        "X2": 3152,
        "Y1": 72,
        "Y2": 1227
      }
    }
  ]
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
#import <Foundation/Foundation.h>
NSDictionary *parameters = @{ @"SKU": @"Mug-11oz",
                              @"Template": @"Single",
                              @"Images": @[ @{ @"LayerId": @"9A5BD", @"Image": @{ @"Url": @"http://app-imgs.print.io/temp/4a6d6997-347e-44a1-aef7-63f3bdc0f8b3-test092214b.jpg", @"MaxFit": @"true", @"X1": @677, @"X2": @3152, @"Y1": @72, @"Y2": @1227 } } ] };

NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.print.io/api/v/5/source/api/productpreview/?recipeid=f255af6f-9614-4fe2-aa8b-1b77b936d9d6"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[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];
open Cohttp_lwt_unix
open Cohttp
open Lwt

let uri = Uri.of_string "https://api.print.io/api/v/5/source/api/productpreview/?recipeid=f255af6f-9614-4fe2-aa8b-1b77b936d9d6" in
let body = Cohttp_lwt_body.of_string "{\"SKU\":\"Mug-11oz\",\"Template\":\"Single\",\"Images\":[{\"LayerId\":\"9A5BD\",\"Image\":{\"Url\":\"http://app-imgs.print.io/temp/4a6d6997-347e-44a1-aef7-63f3bdc0f8b3-test092214b.jpg\",\"MaxFit\":\"true\",\"X1\":677,\"X2\":3152,\"Y1\":72,\"Y2\":1227}}]}" in

Client.call ~body `POST uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.print.io/api/v/5/source/api/productpreview/?recipeid=f255af6f-9614-4fe2-aa8b-1b77b936d9d6",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"SKU\":\"Mug-11oz\",\"Template\":\"Single\",\"Images\":[{\"LayerId\":\"9A5BD\",\"Image\":{\"Url\":\"http://app-imgs.print.io/temp/4a6d6997-347e-44a1-aef7-63f3bdc0f8b3-test092214b.jpg\",\"MaxFit\":\"true\",\"X1\":677,\"X2\":3152,\"Y1\":72,\"Y2\":1227}}]}",
  CURLOPT_HTTPHEADER => array(
    "content-type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
<?php

$request = new HttpRequest();
$request->setUrl('https://api.print.io/api/v/5/source/api/productpreview/');
$request->setMethod(HTTP_METH_POST);

$request->setQueryData(array(
  'recipeid' => 'f255af6f-9614-4fe2-aa8b-1b77b936d9d6'
));

$request->setHeaders(array(
  'content-type' => 'application/json'
));

$request->setBody('{"SKU":"Mug-11oz","Template":"Single","Images":[{"LayerId":"9A5BD","Image":{"Url":"http://app-imgs.print.io/temp/4a6d6997-347e-44a1-aef7-63f3bdc0f8b3-test092214b.jpg","MaxFit":"true","X1":677,"X2":3152,"Y1":72,"Y2":1227}}]}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
<?php

$client = new http\Client;
$request = new http\Client\Request;

$body = new http\Message\Body;
$body->append('{"SKU":"Mug-11oz","Template":"Single","Images":[{"LayerId":"9A5BD","Image":{"Url":"http://app-imgs.print.io/temp/4a6d6997-347e-44a1-aef7-63f3bdc0f8b3-test092214b.jpg","MaxFit":"true","X1":677,"X2":3152,"Y1":72,"Y2":1227}}]}');

$request->setRequestUrl('https://api.print.io/api/v/5/source/api/productpreview/');
$request->setRequestMethod('POST');
$request->setBody($body);

$request->setQuery(new http\QueryString(array(
  'recipeid' => 'f255af6f-9614-4fe2-aa8b-1b77b936d9d6'
)));

$request->setHeaders(array(
  'content-type' => 'application/json'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri 'https://api.print.io/api/v/5/source/api/productpreview/?recipeid=f255af6f-9614-4fe2-aa8b-1b77b936d9d6' -Method POST -Headers $headers -ContentType 'undefined' -Body '{"SKU":"Mug-11oz","Template":"Single","Images":[{"LayerId":"9A5BD","Image":{"Url":"http://app-imgs.print.io/temp/4a6d6997-347e-44a1-aef7-63f3bdc0f8b3-test092214b.jpg","MaxFit":"true","X1":677,"X2":3152,"Y1":72,"Y2":1227}}]}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri 'https://api.print.io/api/v/5/source/api/productpreview/?recipeid=f255af6f-9614-4fe2-aa8b-1b77b936d9d6' -Method POST -Headers $headers -ContentType 'undefined' -Body '{"SKU":"Mug-11oz","Template":"Single","Images":[{"LayerId":"9A5BD","Image":{"Url":"http://app-imgs.print.io/temp/4a6d6997-347e-44a1-aef7-63f3bdc0f8b3-test092214b.jpg","MaxFit":"true","X1":677,"X2":3152,"Y1":72,"Y2":1227}}]}'
import http.client

conn = http.client.HTTPSConnection("api.print.io")

payload = "{\"SKU\":\"Mug-11oz\",\"Template\":\"Single\",\"Images\":[{\"LayerId\":\"9A5BD\",\"Image\":{\"Url\":\"http://app-imgs.print.io/temp/4a6d6997-347e-44a1-aef7-63f3bdc0f8b3-test092214b.jpg\",\"MaxFit\":\"true\",\"X1\":677,\"X2\":3152,\"Y1\":72,\"Y2\":1227}}]}"

conn.request("POST", "/api/v/5/source/api/productpreview/?recipeid=f255af6f-9614-4fe2-aa8b-1b77b936d9d6", payload)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "https://api.print.io/api/v/5/source/api/productpreview/"

querystring = {"recipeid":"f255af6f-9614-4fe2-aa8b-1b77b936d9d6"}

payload = "{\"SKU\":\"Mug-11oz\",\"Template\":\"Single\",\"Images\":[{\"LayerId\":\"9A5BD\",\"Image\":{\"Url\":\"http://app-imgs.print.io/temp/4a6d6997-347e-44a1-aef7-63f3bdc0f8b3-test092214b.jpg\",\"MaxFit\":\"true\",\"X1\":677,\"X2\":3152,\"Y1\":72,\"Y2\":1227}}]}"
response = requests.request("POST", url, data=payload, params=querystring)

print(response.text)
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.print.io/api/v/5/source/api/productpreview/?recipeid=f255af6f-9614-4fe2-aa8b-1b77b936d9d6")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request.body = "{\"SKU\":\"Mug-11oz\",\"Template\":\"Single\",\"Images\":[{\"LayerId\":\"9A5BD\",\"Image\":{\"Url\":\"http://app-imgs.print.io/temp/4a6d6997-347e-44a1-aef7-63f3bdc0f8b3-test092214b.jpg\",\"MaxFit\":\"true\",\"X1\":677,\"X2\":3152,\"Y1\":72,\"Y2\":1227}}]}"

response = http.request(request)
puts response.read_body
curl --request POST \
  --url 'https://api.print.io/api/v/5/source/api/productpreview/?recipeid=f255af6f-9614-4fe2-aa8b-1b77b936d9d6' \
  --header 'content-type: application/json' \
  --data '{"SKU":"Mug-11oz","Template":"Single","Images":[{"LayerId":"9A5BD","Image":{"Url":"http://app-imgs.print.io/temp/4a6d6997-347e-44a1-aef7-63f3bdc0f8b3-test092214b.jpg","MaxFit":"true","X1":677,"X2":3152,"Y1":72,"Y2":1227}}]}'
echo '{"SKU":"Mug-11oz","Template":"Single","Images":[{"LayerId":"9A5BD","Image":{"Url":"http://app-imgs.print.io/temp/4a6d6997-347e-44a1-aef7-63f3bdc0f8b3-test092214b.jpg","MaxFit":"true","X1":677,"X2":3152,"Y1":72,"Y2":1227}}]}' |  \
  http POST 'https://api.print.io/api/v/5/source/api/productpreview/?recipeid=f255af6f-9614-4fe2-aa8b-1b77b936d9d6'
wget --quiet \
  --method POST \
  --body-data '{"SKU":"Mug-11oz","Template":"Single","Images":[{"LayerId":"9A5BD","Image":{"Url":"http://app-imgs.print.io/temp/4a6d6997-347e-44a1-aef7-63f3bdc0f8b3-test092214b.jpg","MaxFit":"true","X1":677,"X2":3152,"Y1":72,"Y2":1227}}]}' \
  --output-document \
  - 'https://api.print.io/api/v/5/source/api/productpreview/?recipeid=f255af6f-9614-4fe2-aa8b-1b77b936d9d6'
import Foundation
let parameters = [
  "SKU": "Mug-11oz",
  "Template": "Single",
  "Images": [
    [
      "LayerId": "9A5BD",
      "Image": [
        "Url": "http://app-imgs.print.io/temp/4a6d6997-347e-44a1-aef7-63f3bdc0f8b3-test092214b.jpg",
        "MaxFit": "true",
        "X1": 677,
        "X2": 3152,
        "Y1": 72,
        "Y2": 1227
      ]
    ]
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.print.io/api/v/5/source/api/productpreview/?recipeid=f255af6f-9614-4fe2-aa8b-1b77b936d9d6")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()