Bets API
PUT
Allows a trusted application to cash in a bet (take a return on a bet) on behalf of the customer
{{baseUrl}}/:betId/cashin
HEADERS
apiKey
apiSecret
apiTicket
QUERY PARAMS
cashInValue
cashinBetDelayId
betId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:betId/cashin?cashInValue=&cashinBetDelayId=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "apikey: ");
headers = curl_slist_append(headers, "apisecret: ");
headers = curl_slist_append(headers, "apiticket: ");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/:betId/cashin" {:headers {:apikey ""
:apisecret ""
:apiticket ""}
:query-params {:cashInValue ""
:cashinBetDelayId ""}})
require "http/client"
url = "{{baseUrl}}/:betId/cashin?cashInValue=&cashinBetDelayId="
headers = HTTP::Headers{
"apikey" => ""
"apisecret" => ""
"apiticket" => ""
}
response = HTTP::Client.put url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/:betId/cashin?cashInValue=&cashinBetDelayId="),
Headers =
{
{ "apikey", "" },
{ "apisecret", "" },
{ "apiticket", "" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:betId/cashin?cashInValue=&cashinBetDelayId=");
var request = new RestRequest("", Method.Put);
request.AddHeader("apikey", "");
request.AddHeader("apisecret", "");
request.AddHeader("apiticket", "");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:betId/cashin?cashInValue=&cashinBetDelayId="
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("apikey", "")
req.Header.Add("apisecret", "")
req.Header.Add("apiticket", "")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/:betId/cashin?cashInValue=&cashinBetDelayId= HTTP/1.1
Apikey:
Apisecret:
Apiticket:
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/:betId/cashin?cashInValue=&cashinBetDelayId=")
.setHeader("apikey", "")
.setHeader("apisecret", "")
.setHeader("apiticket", "")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:betId/cashin?cashInValue=&cashinBetDelayId="))
.header("apikey", "")
.header("apisecret", "")
.header("apiticket", "")
.method("PUT", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:betId/cashin?cashInValue=&cashinBetDelayId=")
.put(null)
.addHeader("apikey", "")
.addHeader("apisecret", "")
.addHeader("apiticket", "")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/:betId/cashin?cashInValue=&cashinBetDelayId=")
.header("apikey", "")
.header("apisecret", "")
.header("apiticket", "")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/:betId/cashin?cashInValue=&cashinBetDelayId=');
xhr.setRequestHeader('apikey', '');
xhr.setRequestHeader('apisecret', '');
xhr.setRequestHeader('apiticket', '');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/:betId/cashin',
params: {cashInValue: '', cashinBetDelayId: ''},
headers: {apikey: '', apisecret: '', apiticket: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:betId/cashin?cashInValue=&cashinBetDelayId=';
const options = {method: 'PUT', headers: {apikey: '', apisecret: '', apiticket: ''}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/:betId/cashin?cashInValue=&cashinBetDelayId=',
method: 'PUT',
headers: {
apikey: '',
apisecret: '',
apiticket: ''
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:betId/cashin?cashInValue=&cashinBetDelayId=")
.put(null)
.addHeader("apikey", "")
.addHeader("apisecret", "")
.addHeader("apiticket", "")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/:betId/cashin?cashInValue=&cashinBetDelayId=',
headers: {
apikey: '',
apisecret: '',
apiticket: ''
}
};
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.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/:betId/cashin',
qs: {cashInValue: '', cashinBetDelayId: ''},
headers: {apikey: '', apisecret: '', apiticket: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/:betId/cashin');
req.query({
cashInValue: '',
cashinBetDelayId: ''
});
req.headers({
apikey: '',
apisecret: '',
apiticket: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/:betId/cashin',
params: {cashInValue: '', cashinBetDelayId: ''},
headers: {apikey: '', apisecret: '', apiticket: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:betId/cashin?cashInValue=&cashinBetDelayId=';
const options = {method: 'PUT', headers: {apikey: '', apisecret: '', apiticket: ''}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"apikey": @"",
@"apisecret": @"",
@"apiticket": @"" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:betId/cashin?cashInValue=&cashinBetDelayId="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
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 "{{baseUrl}}/:betId/cashin?cashInValue=&cashinBetDelayId=" in
let headers = Header.add_list (Header.init ()) [
("apikey", "");
("apisecret", "");
("apiticket", "");
] in
Client.call ~headers `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:betId/cashin?cashInValue=&cashinBetDelayId=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"apikey: ",
"apisecret: ",
"apiticket: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/:betId/cashin?cashInValue=&cashinBetDelayId=', [
'headers' => [
'apikey' => '',
'apisecret' => '',
'apiticket' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:betId/cashin');
$request->setMethod(HTTP_METH_PUT);
$request->setQueryData([
'cashInValue' => '',
'cashinBetDelayId' => ''
]);
$request->setHeaders([
'apikey' => '',
'apisecret' => '',
'apiticket' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:betId/cashin');
$request->setRequestMethod('PUT');
$request->setQuery(new http\QueryString([
'cashInValue' => '',
'cashinBetDelayId' => ''
]));
$request->setHeaders([
'apikey' => '',
'apisecret' => '',
'apiticket' => ''
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("apikey", "")
$headers.Add("apisecret", "")
$headers.Add("apiticket", "")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:betId/cashin?cashInValue=&cashinBetDelayId=' -Method PUT -Headers $headers
$headers=@{}
$headers.Add("apikey", "")
$headers.Add("apisecret", "")
$headers.Add("apiticket", "")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:betId/cashin?cashInValue=&cashinBetDelayId=' -Method PUT -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'apikey': "",
'apisecret': "",
'apiticket': ""
}
conn.request("PUT", "/baseUrl/:betId/cashin?cashInValue=&cashinBetDelayId=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:betId/cashin"
querystring = {"cashInValue":"","cashinBetDelayId":""}
headers = {
"apikey": "",
"apisecret": "",
"apiticket": ""
}
response = requests.put(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:betId/cashin"
queryString <- list(
cashInValue = "",
cashinBetDelayId = ""
)
response <- VERB("PUT", url, query = queryString, add_headers('apikey' = '', 'apisecret' = '', 'apiticket' = ''), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:betId/cashin?cashInValue=&cashinBetDelayId=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["apikey"] = ''
request["apisecret"] = ''
request["apiticket"] = ''
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.put('/baseUrl/:betId/cashin') do |req|
req.headers['apikey'] = ''
req.headers['apisecret'] = ''
req.headers['apiticket'] = ''
req.params['cashInValue'] = ''
req.params['cashinBetDelayId'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:betId/cashin";
let querystring = [
("cashInValue", ""),
("cashinBetDelayId", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("apikey", "".parse().unwrap());
headers.insert("apisecret", "".parse().unwrap());
headers.insert("apiticket", "".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url '{{baseUrl}}/:betId/cashin?cashInValue=&cashinBetDelayId=' \
--header 'apikey: ' \
--header 'apisecret: ' \
--header 'apiticket: '
http PUT '{{baseUrl}}/:betId/cashin?cashInValue=&cashinBetDelayId=' \
apikey:'' \
apisecret:'' \
apiticket:''
wget --quiet \
--method PUT \
--header 'apikey: ' \
--header 'apisecret: ' \
--header 'apiticket: ' \
--output-document \
- '{{baseUrl}}/:betId/cashin?cashInValue=&cashinBetDelayId='
import Foundation
let headers = [
"apikey": "",
"apisecret": "",
"apiticket": ""
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:betId/cashin?cashInValue=&cashinBetDelayId=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
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
Places a multiple or a complex bet.
{{baseUrl}}/bet/complex
HEADERS
apiKey
apiSecret
apiTicket
BODY json
{
"bets": [
{
"delayedBetId": "",
"freeBetId": "",
"legs": [
{
"parts": [
{
"includeInMultiple": false,
"priceDen": 0,
"priceNum": 0,
"priceType": 0,
"selectionId": 0
}
],
"sort": "",
"type": ""
}
],
"number": 0,
"stake": "",
"typeCode": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/bet/complex");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "apikey: ");
headers = curl_slist_append(headers, "apisecret: ");
headers = curl_slist_append(headers, "apiticket: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"bets\": [\n {\n \"delayedBetId\": \"\",\n \"freeBetId\": \"\",\n \"legs\": [\n {\n \"parts\": [\n {\n \"includeInMultiple\": false,\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": 0,\n \"selectionId\": 0\n }\n ],\n \"sort\": \"\",\n \"type\": \"\"\n }\n ],\n \"number\": 0,\n \"stake\": \"\",\n \"typeCode\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/bet/complex" {:headers {:apikey ""
:apisecret ""
:apiticket ""}
:content-type :json
:form-params {:bets [{:delayedBetId ""
:freeBetId ""
:legs [{:parts [{:includeInMultiple false
:priceDen 0
:priceNum 0
:priceType 0
:selectionId 0}]
:sort ""
:type ""}]
:number 0
:stake ""
:typeCode ""}]}})
require "http/client"
url = "{{baseUrl}}/bet/complex"
headers = HTTP::Headers{
"apikey" => ""
"apisecret" => ""
"apiticket" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"bets\": [\n {\n \"delayedBetId\": \"\",\n \"freeBetId\": \"\",\n \"legs\": [\n {\n \"parts\": [\n {\n \"includeInMultiple\": false,\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": 0,\n \"selectionId\": 0\n }\n ],\n \"sort\": \"\",\n \"type\": \"\"\n }\n ],\n \"number\": 0,\n \"stake\": \"\",\n \"typeCode\": \"\"\n }\n ]\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/bet/complex"),
Headers =
{
{ "apikey", "" },
{ "apisecret", "" },
{ "apiticket", "" },
},
Content = new StringContent("{\n \"bets\": [\n {\n \"delayedBetId\": \"\",\n \"freeBetId\": \"\",\n \"legs\": [\n {\n \"parts\": [\n {\n \"includeInMultiple\": false,\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": 0,\n \"selectionId\": 0\n }\n ],\n \"sort\": \"\",\n \"type\": \"\"\n }\n ],\n \"number\": 0,\n \"stake\": \"\",\n \"typeCode\": \"\"\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/bet/complex");
var request = new RestRequest("", Method.Post);
request.AddHeader("apikey", "");
request.AddHeader("apisecret", "");
request.AddHeader("apiticket", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"bets\": [\n {\n \"delayedBetId\": \"\",\n \"freeBetId\": \"\",\n \"legs\": [\n {\n \"parts\": [\n {\n \"includeInMultiple\": false,\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": 0,\n \"selectionId\": 0\n }\n ],\n \"sort\": \"\",\n \"type\": \"\"\n }\n ],\n \"number\": 0,\n \"stake\": \"\",\n \"typeCode\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/bet/complex"
payload := strings.NewReader("{\n \"bets\": [\n {\n \"delayedBetId\": \"\",\n \"freeBetId\": \"\",\n \"legs\": [\n {\n \"parts\": [\n {\n \"includeInMultiple\": false,\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": 0,\n \"selectionId\": 0\n }\n ],\n \"sort\": \"\",\n \"type\": \"\"\n }\n ],\n \"number\": 0,\n \"stake\": \"\",\n \"typeCode\": \"\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "")
req.Header.Add("apisecret", "")
req.Header.Add("apiticket", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/bet/complex HTTP/1.1
Apikey:
Apisecret:
Apiticket:
Content-Type: application/json
Host: example.com
Content-Length: 450
{
"bets": [
{
"delayedBetId": "",
"freeBetId": "",
"legs": [
{
"parts": [
{
"includeInMultiple": false,
"priceDen": 0,
"priceNum": 0,
"priceType": 0,
"selectionId": 0
}
],
"sort": "",
"type": ""
}
],
"number": 0,
"stake": "",
"typeCode": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/bet/complex")
.setHeader("apikey", "")
.setHeader("apisecret", "")
.setHeader("apiticket", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"bets\": [\n {\n \"delayedBetId\": \"\",\n \"freeBetId\": \"\",\n \"legs\": [\n {\n \"parts\": [\n {\n \"includeInMultiple\": false,\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": 0,\n \"selectionId\": 0\n }\n ],\n \"sort\": \"\",\n \"type\": \"\"\n }\n ],\n \"number\": 0,\n \"stake\": \"\",\n \"typeCode\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/bet/complex"))
.header("apikey", "")
.header("apisecret", "")
.header("apiticket", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"bets\": [\n {\n \"delayedBetId\": \"\",\n \"freeBetId\": \"\",\n \"legs\": [\n {\n \"parts\": [\n {\n \"includeInMultiple\": false,\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": 0,\n \"selectionId\": 0\n }\n ],\n \"sort\": \"\",\n \"type\": \"\"\n }\n ],\n \"number\": 0,\n \"stake\": \"\",\n \"typeCode\": \"\"\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"bets\": [\n {\n \"delayedBetId\": \"\",\n \"freeBetId\": \"\",\n \"legs\": [\n {\n \"parts\": [\n {\n \"includeInMultiple\": false,\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": 0,\n \"selectionId\": 0\n }\n ],\n \"sort\": \"\",\n \"type\": \"\"\n }\n ],\n \"number\": 0,\n \"stake\": \"\",\n \"typeCode\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/bet/complex")
.post(body)
.addHeader("apikey", "")
.addHeader("apisecret", "")
.addHeader("apiticket", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/bet/complex")
.header("apikey", "")
.header("apisecret", "")
.header("apiticket", "")
.header("content-type", "application/json")
.body("{\n \"bets\": [\n {\n \"delayedBetId\": \"\",\n \"freeBetId\": \"\",\n \"legs\": [\n {\n \"parts\": [\n {\n \"includeInMultiple\": false,\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": 0,\n \"selectionId\": 0\n }\n ],\n \"sort\": \"\",\n \"type\": \"\"\n }\n ],\n \"number\": 0,\n \"stake\": \"\",\n \"typeCode\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
bets: [
{
delayedBetId: '',
freeBetId: '',
legs: [
{
parts: [
{
includeInMultiple: false,
priceDen: 0,
priceNum: 0,
priceType: 0,
selectionId: 0
}
],
sort: '',
type: ''
}
],
number: 0,
stake: '',
typeCode: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/bet/complex');
xhr.setRequestHeader('apikey', '');
xhr.setRequestHeader('apisecret', '');
xhr.setRequestHeader('apiticket', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/bet/complex',
headers: {apikey: '', apisecret: '', apiticket: '', 'content-type': 'application/json'},
data: {
bets: [
{
delayedBetId: '',
freeBetId: '',
legs: [
{
parts: [
{
includeInMultiple: false,
priceDen: 0,
priceNum: 0,
priceType: 0,
selectionId: 0
}
],
sort: '',
type: ''
}
],
number: 0,
stake: '',
typeCode: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/bet/complex';
const options = {
method: 'POST',
headers: {apikey: '', apisecret: '', apiticket: '', 'content-type': 'application/json'},
body: '{"bets":[{"delayedBetId":"","freeBetId":"","legs":[{"parts":[{"includeInMultiple":false,"priceDen":0,"priceNum":0,"priceType":0,"selectionId":0}],"sort":"","type":""}],"number":0,"stake":"","typeCode":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/bet/complex',
method: 'POST',
headers: {
apikey: '',
apisecret: '',
apiticket: '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "bets": [\n {\n "delayedBetId": "",\n "freeBetId": "",\n "legs": [\n {\n "parts": [\n {\n "includeInMultiple": false,\n "priceDen": 0,\n "priceNum": 0,\n "priceType": 0,\n "selectionId": 0\n }\n ],\n "sort": "",\n "type": ""\n }\n ],\n "number": 0,\n "stake": "",\n "typeCode": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"bets\": [\n {\n \"delayedBetId\": \"\",\n \"freeBetId\": \"\",\n \"legs\": [\n {\n \"parts\": [\n {\n \"includeInMultiple\": false,\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": 0,\n \"selectionId\": 0\n }\n ],\n \"sort\": \"\",\n \"type\": \"\"\n }\n ],\n \"number\": 0,\n \"stake\": \"\",\n \"typeCode\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/bet/complex")
.post(body)
.addHeader("apikey", "")
.addHeader("apisecret", "")
.addHeader("apiticket", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/bet/complex',
headers: {
apikey: '',
apisecret: '',
apiticket: '',
'content-type': 'application/json'
}
};
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(JSON.stringify({
bets: [
{
delayedBetId: '',
freeBetId: '',
legs: [
{
parts: [
{
includeInMultiple: false,
priceDen: 0,
priceNum: 0,
priceType: 0,
selectionId: 0
}
],
sort: '',
type: ''
}
],
number: 0,
stake: '',
typeCode: ''
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/bet/complex',
headers: {apikey: '', apisecret: '', apiticket: '', 'content-type': 'application/json'},
body: {
bets: [
{
delayedBetId: '',
freeBetId: '',
legs: [
{
parts: [
{
includeInMultiple: false,
priceDen: 0,
priceNum: 0,
priceType: 0,
selectionId: 0
}
],
sort: '',
type: ''
}
],
number: 0,
stake: '',
typeCode: ''
}
]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/bet/complex');
req.headers({
apikey: '',
apisecret: '',
apiticket: '',
'content-type': 'application/json'
});
req.type('json');
req.send({
bets: [
{
delayedBetId: '',
freeBetId: '',
legs: [
{
parts: [
{
includeInMultiple: false,
priceDen: 0,
priceNum: 0,
priceType: 0,
selectionId: 0
}
],
sort: '',
type: ''
}
],
number: 0,
stake: '',
typeCode: ''
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/bet/complex',
headers: {apikey: '', apisecret: '', apiticket: '', 'content-type': 'application/json'},
data: {
bets: [
{
delayedBetId: '',
freeBetId: '',
legs: [
{
parts: [
{
includeInMultiple: false,
priceDen: 0,
priceNum: 0,
priceType: 0,
selectionId: 0
}
],
sort: '',
type: ''
}
],
number: 0,
stake: '',
typeCode: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/bet/complex';
const options = {
method: 'POST',
headers: {apikey: '', apisecret: '', apiticket: '', 'content-type': 'application/json'},
body: '{"bets":[{"delayedBetId":"","freeBetId":"","legs":[{"parts":[{"includeInMultiple":false,"priceDen":0,"priceNum":0,"priceType":0,"selectionId":0}],"sort":"","type":""}],"number":0,"stake":"","typeCode":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"apikey": @"",
@"apisecret": @"",
@"apiticket": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"bets": @[ @{ @"delayedBetId": @"", @"freeBetId": @"", @"legs": @[ @{ @"parts": @[ @{ @"includeInMultiple": @NO, @"priceDen": @0, @"priceNum": @0, @"priceType": @0, @"selectionId": @0 } ], @"sort": @"", @"type": @"" } ], @"number": @0, @"stake": @"", @"typeCode": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/bet/complex"]
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];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/bet/complex" in
let headers = Header.add_list (Header.init ()) [
("apikey", "");
("apisecret", "");
("apiticket", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"bets\": [\n {\n \"delayedBetId\": \"\",\n \"freeBetId\": \"\",\n \"legs\": [\n {\n \"parts\": [\n {\n \"includeInMultiple\": false,\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": 0,\n \"selectionId\": 0\n }\n ],\n \"sort\": \"\",\n \"type\": \"\"\n }\n ],\n \"number\": 0,\n \"stake\": \"\",\n \"typeCode\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/bet/complex",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'bets' => [
[
'delayedBetId' => '',
'freeBetId' => '',
'legs' => [
[
'parts' => [
[
'includeInMultiple' => null,
'priceDen' => 0,
'priceNum' => 0,
'priceType' => 0,
'selectionId' => 0
]
],
'sort' => '',
'type' => ''
]
],
'number' => 0,
'stake' => '',
'typeCode' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"apikey: ",
"apisecret: ",
"apiticket: ",
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/bet/complex', [
'body' => '{
"bets": [
{
"delayedBetId": "",
"freeBetId": "",
"legs": [
{
"parts": [
{
"includeInMultiple": false,
"priceDen": 0,
"priceNum": 0,
"priceType": 0,
"selectionId": 0
}
],
"sort": "",
"type": ""
}
],
"number": 0,
"stake": "",
"typeCode": ""
}
]
}',
'headers' => [
'apikey' => '',
'apisecret' => '',
'apiticket' => '',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/bet/complex');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'apikey' => '',
'apisecret' => '',
'apiticket' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'bets' => [
[
'delayedBetId' => '',
'freeBetId' => '',
'legs' => [
[
'parts' => [
[
'includeInMultiple' => null,
'priceDen' => 0,
'priceNum' => 0,
'priceType' => 0,
'selectionId' => 0
]
],
'sort' => '',
'type' => ''
]
],
'number' => 0,
'stake' => '',
'typeCode' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'bets' => [
[
'delayedBetId' => '',
'freeBetId' => '',
'legs' => [
[
'parts' => [
[
'includeInMultiple' => null,
'priceDen' => 0,
'priceNum' => 0,
'priceType' => 0,
'selectionId' => 0
]
],
'sort' => '',
'type' => ''
]
],
'number' => 0,
'stake' => '',
'typeCode' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/bet/complex');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'apikey' => '',
'apisecret' => '',
'apiticket' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("apikey", "")
$headers.Add("apisecret", "")
$headers.Add("apiticket", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/bet/complex' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"bets": [
{
"delayedBetId": "",
"freeBetId": "",
"legs": [
{
"parts": [
{
"includeInMultiple": false,
"priceDen": 0,
"priceNum": 0,
"priceType": 0,
"selectionId": 0
}
],
"sort": "",
"type": ""
}
],
"number": 0,
"stake": "",
"typeCode": ""
}
]
}'
$headers=@{}
$headers.Add("apikey", "")
$headers.Add("apisecret", "")
$headers.Add("apiticket", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/bet/complex' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"bets": [
{
"delayedBetId": "",
"freeBetId": "",
"legs": [
{
"parts": [
{
"includeInMultiple": false,
"priceDen": 0,
"priceNum": 0,
"priceType": 0,
"selectionId": 0
}
],
"sort": "",
"type": ""
}
],
"number": 0,
"stake": "",
"typeCode": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"bets\": [\n {\n \"delayedBetId\": \"\",\n \"freeBetId\": \"\",\n \"legs\": [\n {\n \"parts\": [\n {\n \"includeInMultiple\": false,\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": 0,\n \"selectionId\": 0\n }\n ],\n \"sort\": \"\",\n \"type\": \"\"\n }\n ],\n \"number\": 0,\n \"stake\": \"\",\n \"typeCode\": \"\"\n }\n ]\n}"
headers = {
'apikey': "",
'apisecret': "",
'apiticket': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/bet/complex", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/bet/complex"
payload = { "bets": [
{
"delayedBetId": "",
"freeBetId": "",
"legs": [
{
"parts": [
{
"includeInMultiple": False,
"priceDen": 0,
"priceNum": 0,
"priceType": 0,
"selectionId": 0
}
],
"sort": "",
"type": ""
}
],
"number": 0,
"stake": "",
"typeCode": ""
}
] }
headers = {
"apikey": "",
"apisecret": "",
"apiticket": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/bet/complex"
payload <- "{\n \"bets\": [\n {\n \"delayedBetId\": \"\",\n \"freeBetId\": \"\",\n \"legs\": [\n {\n \"parts\": [\n {\n \"includeInMultiple\": false,\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": 0,\n \"selectionId\": 0\n }\n ],\n \"sort\": \"\",\n \"type\": \"\"\n }\n ],\n \"number\": 0,\n \"stake\": \"\",\n \"typeCode\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('apikey' = '', 'apisecret' = '', 'apiticket' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/bet/complex")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = ''
request["apisecret"] = ''
request["apiticket"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"bets\": [\n {\n \"delayedBetId\": \"\",\n \"freeBetId\": \"\",\n \"legs\": [\n {\n \"parts\": [\n {\n \"includeInMultiple\": false,\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": 0,\n \"selectionId\": 0\n }\n ],\n \"sort\": \"\",\n \"type\": \"\"\n }\n ],\n \"number\": 0,\n \"stake\": \"\",\n \"typeCode\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/bet/complex') do |req|
req.headers['apikey'] = ''
req.headers['apisecret'] = ''
req.headers['apiticket'] = ''
req.body = "{\n \"bets\": [\n {\n \"delayedBetId\": \"\",\n \"freeBetId\": \"\",\n \"legs\": [\n {\n \"parts\": [\n {\n \"includeInMultiple\": false,\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": 0,\n \"selectionId\": 0\n }\n ],\n \"sort\": \"\",\n \"type\": \"\"\n }\n ],\n \"number\": 0,\n \"stake\": \"\",\n \"typeCode\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/bet/complex";
let payload = json!({"bets": (
json!({
"delayedBetId": "",
"freeBetId": "",
"legs": (
json!({
"parts": (
json!({
"includeInMultiple": false,
"priceDen": 0,
"priceNum": 0,
"priceType": 0,
"selectionId": 0
})
),
"sort": "",
"type": ""
})
),
"number": 0,
"stake": "",
"typeCode": ""
})
)});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("apikey", "".parse().unwrap());
headers.insert("apisecret", "".parse().unwrap());
headers.insert("apiticket", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/bet/complex \
--header 'apikey: ' \
--header 'apisecret: ' \
--header 'apiticket: ' \
--header 'content-type: application/json' \
--data '{
"bets": [
{
"delayedBetId": "",
"freeBetId": "",
"legs": [
{
"parts": [
{
"includeInMultiple": false,
"priceDen": 0,
"priceNum": 0,
"priceType": 0,
"selectionId": 0
}
],
"sort": "",
"type": ""
}
],
"number": 0,
"stake": "",
"typeCode": ""
}
]
}'
echo '{
"bets": [
{
"delayedBetId": "",
"freeBetId": "",
"legs": [
{
"parts": [
{
"includeInMultiple": false,
"priceDen": 0,
"priceNum": 0,
"priceType": 0,
"selectionId": 0
}
],
"sort": "",
"type": ""
}
],
"number": 0,
"stake": "",
"typeCode": ""
}
]
}' | \
http POST {{baseUrl}}/bet/complex \
apikey:'' \
apisecret:'' \
apiticket:'' \
content-type:application/json
wget --quiet \
--method POST \
--header 'apikey: ' \
--header 'apisecret: ' \
--header 'apiticket: ' \
--header 'content-type: application/json' \
--body-data '{\n "bets": [\n {\n "delayedBetId": "",\n "freeBetId": "",\n "legs": [\n {\n "parts": [\n {\n "includeInMultiple": false,\n "priceDen": 0,\n "priceNum": 0,\n "priceType": 0,\n "selectionId": 0\n }\n ],\n "sort": "",\n "type": ""\n }\n ],\n "number": 0,\n "stake": "",\n "typeCode": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/bet/complex
import Foundation
let headers = [
"apikey": "",
"apisecret": "",
"apiticket": "",
"content-type": "application/json"
]
let parameters = ["bets": [
[
"delayedBetId": "",
"freeBetId": "",
"legs": [
[
"parts": [
[
"includeInMultiple": false,
"priceDen": 0,
"priceNum": 0,
"priceType": 0,
"selectionId": 0
]
],
"sort": "",
"type": ""
]
],
"number": 0,
"stake": "",
"typeCode": ""
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/bet/complex")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"placedBets" : [
{
"id" : 51097,
"number": 1,
"receipt" : "O/0013333/0000109/F",
"numLines" : 1,
"totalStake" : 2.50,
"placedDateTime" : "2015-12-12T00:11:00"
},
{
"id" : 51098,
"number": 2,
"receipt" : "O/0013333/0000109/F",
"numLines" : 1,
"totalStake" : 2.50,
"placedDateTime" : "2015-12-12T00:11:00"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"delayedBets" : [
{
"id" : 51097,
"number" : 1,
"delayedBetId" : "SL-I60Xjir9wr1MWpZf/XnHHycr7mSePgkYbY+aidjVII2AhfeWsWkuLucDnW0PWkJgmos0HO1zY6fMGbptVOezaicYUgKV",
"delayPeriodSeconds" : 5
},
{
"id" : 51098,
"number" : 2,
"delayedBetId" : "SL-I60Xjir8wr1MWpZf/XnHHycr7mSePgkYbY+aidjVII2AhfeWsWkuLucDnW0PWkJgmos0HO1zY6fMGbptVOezaicYUgKV",
"delayPeriodSeconds" : 5
}
]
}
POST
Places a single bet
{{baseUrl}}/bet/single
HEADERS
apiKey
apiSecret
apiTicket
BODY json
{
"delayedBetId": "",
"freeBetId": "",
"priceDen": 0,
"priceNum": 0,
"priceType": "",
"selectionId": "",
"stake": "",
"type": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/bet/single");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "apikey: ");
headers = curl_slist_append(headers, "apisecret: ");
headers = curl_slist_append(headers, "apiticket: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"delayedBetId\": \"\",\n \"freeBetId\": \"\",\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": \"\",\n \"selectionId\": \"\",\n \"stake\": \"\",\n \"type\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/bet/single" {:headers {:apikey ""
:apisecret ""
:apiticket ""}
:content-type :json
:form-params {:delayedBetId ""
:freeBetId ""
:priceDen 0
:priceNum 0
:priceType ""
:selectionId ""
:stake ""
:type ""}})
require "http/client"
url = "{{baseUrl}}/bet/single"
headers = HTTP::Headers{
"apikey" => ""
"apisecret" => ""
"apiticket" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"delayedBetId\": \"\",\n \"freeBetId\": \"\",\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": \"\",\n \"selectionId\": \"\",\n \"stake\": \"\",\n \"type\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/bet/single"),
Headers =
{
{ "apikey", "" },
{ "apisecret", "" },
{ "apiticket", "" },
},
Content = new StringContent("{\n \"delayedBetId\": \"\",\n \"freeBetId\": \"\",\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": \"\",\n \"selectionId\": \"\",\n \"stake\": \"\",\n \"type\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/bet/single");
var request = new RestRequest("", Method.Post);
request.AddHeader("apikey", "");
request.AddHeader("apisecret", "");
request.AddHeader("apiticket", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"delayedBetId\": \"\",\n \"freeBetId\": \"\",\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": \"\",\n \"selectionId\": \"\",\n \"stake\": \"\",\n \"type\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/bet/single"
payload := strings.NewReader("{\n \"delayedBetId\": \"\",\n \"freeBetId\": \"\",\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": \"\",\n \"selectionId\": \"\",\n \"stake\": \"\",\n \"type\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "")
req.Header.Add("apisecret", "")
req.Header.Add("apiticket", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/bet/single HTTP/1.1
Apikey:
Apisecret:
Apiticket:
Content-Type: application/json
Host: example.com
Content-Length: 146
{
"delayedBetId": "",
"freeBetId": "",
"priceDen": 0,
"priceNum": 0,
"priceType": "",
"selectionId": "",
"stake": "",
"type": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/bet/single")
.setHeader("apikey", "")
.setHeader("apisecret", "")
.setHeader("apiticket", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"delayedBetId\": \"\",\n \"freeBetId\": \"\",\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": \"\",\n \"selectionId\": \"\",\n \"stake\": \"\",\n \"type\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/bet/single"))
.header("apikey", "")
.header("apisecret", "")
.header("apiticket", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"delayedBetId\": \"\",\n \"freeBetId\": \"\",\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": \"\",\n \"selectionId\": \"\",\n \"stake\": \"\",\n \"type\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"delayedBetId\": \"\",\n \"freeBetId\": \"\",\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": \"\",\n \"selectionId\": \"\",\n \"stake\": \"\",\n \"type\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/bet/single")
.post(body)
.addHeader("apikey", "")
.addHeader("apisecret", "")
.addHeader("apiticket", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/bet/single")
.header("apikey", "")
.header("apisecret", "")
.header("apiticket", "")
.header("content-type", "application/json")
.body("{\n \"delayedBetId\": \"\",\n \"freeBetId\": \"\",\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": \"\",\n \"selectionId\": \"\",\n \"stake\": \"\",\n \"type\": \"\"\n}")
.asString();
const data = JSON.stringify({
delayedBetId: '',
freeBetId: '',
priceDen: 0,
priceNum: 0,
priceType: '',
selectionId: '',
stake: '',
type: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/bet/single');
xhr.setRequestHeader('apikey', '');
xhr.setRequestHeader('apisecret', '');
xhr.setRequestHeader('apiticket', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/bet/single',
headers: {apikey: '', apisecret: '', apiticket: '', 'content-type': 'application/json'},
data: {
delayedBetId: '',
freeBetId: '',
priceDen: 0,
priceNum: 0,
priceType: '',
selectionId: '',
stake: '',
type: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/bet/single';
const options = {
method: 'POST',
headers: {apikey: '', apisecret: '', apiticket: '', 'content-type': 'application/json'},
body: '{"delayedBetId":"","freeBetId":"","priceDen":0,"priceNum":0,"priceType":"","selectionId":"","stake":"","type":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/bet/single',
method: 'POST',
headers: {
apikey: '',
apisecret: '',
apiticket: '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "delayedBetId": "",\n "freeBetId": "",\n "priceDen": 0,\n "priceNum": 0,\n "priceType": "",\n "selectionId": "",\n "stake": "",\n "type": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"delayedBetId\": \"\",\n \"freeBetId\": \"\",\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": \"\",\n \"selectionId\": \"\",\n \"stake\": \"\",\n \"type\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/bet/single")
.post(body)
.addHeader("apikey", "")
.addHeader("apisecret", "")
.addHeader("apiticket", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/bet/single',
headers: {
apikey: '',
apisecret: '',
apiticket: '',
'content-type': 'application/json'
}
};
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(JSON.stringify({
delayedBetId: '',
freeBetId: '',
priceDen: 0,
priceNum: 0,
priceType: '',
selectionId: '',
stake: '',
type: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/bet/single',
headers: {apikey: '', apisecret: '', apiticket: '', 'content-type': 'application/json'},
body: {
delayedBetId: '',
freeBetId: '',
priceDen: 0,
priceNum: 0,
priceType: '',
selectionId: '',
stake: '',
type: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/bet/single');
req.headers({
apikey: '',
apisecret: '',
apiticket: '',
'content-type': 'application/json'
});
req.type('json');
req.send({
delayedBetId: '',
freeBetId: '',
priceDen: 0,
priceNum: 0,
priceType: '',
selectionId: '',
stake: '',
type: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/bet/single',
headers: {apikey: '', apisecret: '', apiticket: '', 'content-type': 'application/json'},
data: {
delayedBetId: '',
freeBetId: '',
priceDen: 0,
priceNum: 0,
priceType: '',
selectionId: '',
stake: '',
type: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/bet/single';
const options = {
method: 'POST',
headers: {apikey: '', apisecret: '', apiticket: '', 'content-type': 'application/json'},
body: '{"delayedBetId":"","freeBetId":"","priceDen":0,"priceNum":0,"priceType":"","selectionId":"","stake":"","type":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"apikey": @"",
@"apisecret": @"",
@"apiticket": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"delayedBetId": @"",
@"freeBetId": @"",
@"priceDen": @0,
@"priceNum": @0,
@"priceType": @"",
@"selectionId": @"",
@"stake": @"",
@"type": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/bet/single"]
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];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/bet/single" in
let headers = Header.add_list (Header.init ()) [
("apikey", "");
("apisecret", "");
("apiticket", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"delayedBetId\": \"\",\n \"freeBetId\": \"\",\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": \"\",\n \"selectionId\": \"\",\n \"stake\": \"\",\n \"type\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/bet/single",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'delayedBetId' => '',
'freeBetId' => '',
'priceDen' => 0,
'priceNum' => 0,
'priceType' => '',
'selectionId' => '',
'stake' => '',
'type' => ''
]),
CURLOPT_HTTPHEADER => [
"apikey: ",
"apisecret: ",
"apiticket: ",
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/bet/single', [
'body' => '{
"delayedBetId": "",
"freeBetId": "",
"priceDen": 0,
"priceNum": 0,
"priceType": "",
"selectionId": "",
"stake": "",
"type": ""
}',
'headers' => [
'apikey' => '',
'apisecret' => '',
'apiticket' => '',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/bet/single');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'apikey' => '',
'apisecret' => '',
'apiticket' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'delayedBetId' => '',
'freeBetId' => '',
'priceDen' => 0,
'priceNum' => 0,
'priceType' => '',
'selectionId' => '',
'stake' => '',
'type' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'delayedBetId' => '',
'freeBetId' => '',
'priceDen' => 0,
'priceNum' => 0,
'priceType' => '',
'selectionId' => '',
'stake' => '',
'type' => ''
]));
$request->setRequestUrl('{{baseUrl}}/bet/single');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'apikey' => '',
'apisecret' => '',
'apiticket' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("apikey", "")
$headers.Add("apisecret", "")
$headers.Add("apiticket", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/bet/single' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"delayedBetId": "",
"freeBetId": "",
"priceDen": 0,
"priceNum": 0,
"priceType": "",
"selectionId": "",
"stake": "",
"type": ""
}'
$headers=@{}
$headers.Add("apikey", "")
$headers.Add("apisecret", "")
$headers.Add("apiticket", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/bet/single' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"delayedBetId": "",
"freeBetId": "",
"priceDen": 0,
"priceNum": 0,
"priceType": "",
"selectionId": "",
"stake": "",
"type": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"delayedBetId\": \"\",\n \"freeBetId\": \"\",\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": \"\",\n \"selectionId\": \"\",\n \"stake\": \"\",\n \"type\": \"\"\n}"
headers = {
'apikey': "",
'apisecret': "",
'apiticket': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/bet/single", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/bet/single"
payload = {
"delayedBetId": "",
"freeBetId": "",
"priceDen": 0,
"priceNum": 0,
"priceType": "",
"selectionId": "",
"stake": "",
"type": ""
}
headers = {
"apikey": "",
"apisecret": "",
"apiticket": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/bet/single"
payload <- "{\n \"delayedBetId\": \"\",\n \"freeBetId\": \"\",\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": \"\",\n \"selectionId\": \"\",\n \"stake\": \"\",\n \"type\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('apikey' = '', 'apisecret' = '', 'apiticket' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/bet/single")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = ''
request["apisecret"] = ''
request["apiticket"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"delayedBetId\": \"\",\n \"freeBetId\": \"\",\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": \"\",\n \"selectionId\": \"\",\n \"stake\": \"\",\n \"type\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/bet/single') do |req|
req.headers['apikey'] = ''
req.headers['apisecret'] = ''
req.headers['apiticket'] = ''
req.body = "{\n \"delayedBetId\": \"\",\n \"freeBetId\": \"\",\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": \"\",\n \"selectionId\": \"\",\n \"stake\": \"\",\n \"type\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/bet/single";
let payload = json!({
"delayedBetId": "",
"freeBetId": "",
"priceDen": 0,
"priceNum": 0,
"priceType": "",
"selectionId": "",
"stake": "",
"type": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("apikey", "".parse().unwrap());
headers.insert("apisecret", "".parse().unwrap());
headers.insert("apiticket", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/bet/single \
--header 'apikey: ' \
--header 'apisecret: ' \
--header 'apiticket: ' \
--header 'content-type: application/json' \
--data '{
"delayedBetId": "",
"freeBetId": "",
"priceDen": 0,
"priceNum": 0,
"priceType": "",
"selectionId": "",
"stake": "",
"type": ""
}'
echo '{
"delayedBetId": "",
"freeBetId": "",
"priceDen": 0,
"priceNum": 0,
"priceType": "",
"selectionId": "",
"stake": "",
"type": ""
}' | \
http POST {{baseUrl}}/bet/single \
apikey:'' \
apisecret:'' \
apiticket:'' \
content-type:application/json
wget --quiet \
--method POST \
--header 'apikey: ' \
--header 'apisecret: ' \
--header 'apiticket: ' \
--header 'content-type: application/json' \
--body-data '{\n "delayedBetId": "",\n "freeBetId": "",\n "priceDen": 0,\n "priceNum": 0,\n "priceType": "",\n "selectionId": "",\n "stake": "",\n "type": ""\n}' \
--output-document \
- {{baseUrl}}/bet/single
import Foundation
let headers = [
"apikey": "",
"apisecret": "",
"apiticket": "",
"content-type": "application/json"
]
let parameters = [
"delayedBetId": "",
"freeBetId": "",
"priceDen": 0,
"priceNum": 0,
"priceType": "",
"selectionId": "",
"stake": "",
"type": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/bet/single")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"placedBets" : [
{
"id" : 51097,
"receipt" : "O/0013333/0000109/F",
"numLines" : 1,
"totalStake" : 2.50,
"placedDateTime" : "2015-12-12T00:11:00"
}
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"delayedBets" : [
{
"id" : 51097,
"delayedBetId" : "SL-I60Xjir9wr1MWpZf/XnHHycr7mSePgkYbY+aidjVII2AhfeWsWkuLucDnW0PWkJgmos0HO1zY6fMGbptVOezaicYUgKV",
"delayPeriodSeconds" : 5
}
]
}
GET
Retrieves the customer’s bet history.
{{baseUrl}}/history
HEADERS
apiKey
apiSecret
apiTicket
QUERY PARAMS
dateFrom
dateTo
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/history?dateFrom=&dateTo=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "apikey: ");
headers = curl_slist_append(headers, "apisecret: ");
headers = curl_slist_append(headers, "apiticket: ");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/history" {:headers {:apikey ""
:apisecret ""
:apiticket ""}
:query-params {:dateFrom ""
:dateTo ""}})
require "http/client"
url = "{{baseUrl}}/history?dateFrom=&dateTo="
headers = HTTP::Headers{
"apikey" => ""
"apisecret" => ""
"apiticket" => ""
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/history?dateFrom=&dateTo="),
Headers =
{
{ "apikey", "" },
{ "apisecret", "" },
{ "apiticket", "" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/history?dateFrom=&dateTo=");
var request = new RestRequest("", Method.Get);
request.AddHeader("apikey", "");
request.AddHeader("apisecret", "");
request.AddHeader("apiticket", "");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/history?dateFrom=&dateTo="
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("apikey", "")
req.Header.Add("apisecret", "")
req.Header.Add("apiticket", "")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/history?dateFrom=&dateTo= HTTP/1.1
Apikey:
Apisecret:
Apiticket:
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/history?dateFrom=&dateTo=")
.setHeader("apikey", "")
.setHeader("apisecret", "")
.setHeader("apiticket", "")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/history?dateFrom=&dateTo="))
.header("apikey", "")
.header("apisecret", "")
.header("apiticket", "")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/history?dateFrom=&dateTo=")
.get()
.addHeader("apikey", "")
.addHeader("apisecret", "")
.addHeader("apiticket", "")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/history?dateFrom=&dateTo=")
.header("apikey", "")
.header("apisecret", "")
.header("apiticket", "")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/history?dateFrom=&dateTo=');
xhr.setRequestHeader('apikey', '');
xhr.setRequestHeader('apisecret', '');
xhr.setRequestHeader('apiticket', '');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/history',
params: {dateFrom: '', dateTo: ''},
headers: {apikey: '', apisecret: '', apiticket: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/history?dateFrom=&dateTo=';
const options = {method: 'GET', headers: {apikey: '', apisecret: '', apiticket: ''}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/history?dateFrom=&dateTo=',
method: 'GET',
headers: {
apikey: '',
apisecret: '',
apiticket: ''
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/history?dateFrom=&dateTo=")
.get()
.addHeader("apikey", "")
.addHeader("apisecret", "")
.addHeader("apiticket", "")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/history?dateFrom=&dateTo=',
headers: {
apikey: '',
apisecret: '',
apiticket: ''
}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/history',
qs: {dateFrom: '', dateTo: ''},
headers: {apikey: '', apisecret: '', apiticket: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/history');
req.query({
dateFrom: '',
dateTo: ''
});
req.headers({
apikey: '',
apisecret: '',
apiticket: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/history',
params: {dateFrom: '', dateTo: ''},
headers: {apikey: '', apisecret: '', apiticket: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/history?dateFrom=&dateTo=';
const options = {method: 'GET', headers: {apikey: '', apisecret: '', apiticket: ''}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"apikey": @"",
@"apisecret": @"",
@"apiticket": @"" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/history?dateFrom=&dateTo="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
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 "{{baseUrl}}/history?dateFrom=&dateTo=" in
let headers = Header.add_list (Header.init ()) [
("apikey", "");
("apisecret", "");
("apiticket", "");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/history?dateFrom=&dateTo=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apikey: ",
"apisecret: ",
"apiticket: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/history?dateFrom=&dateTo=', [
'headers' => [
'apikey' => '',
'apisecret' => '',
'apiticket' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/history');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'dateFrom' => '',
'dateTo' => ''
]);
$request->setHeaders([
'apikey' => '',
'apisecret' => '',
'apiticket' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/history');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'dateFrom' => '',
'dateTo' => ''
]));
$request->setHeaders([
'apikey' => '',
'apisecret' => '',
'apiticket' => ''
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("apikey", "")
$headers.Add("apisecret", "")
$headers.Add("apiticket", "")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/history?dateFrom=&dateTo=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("apikey", "")
$headers.Add("apisecret", "")
$headers.Add("apiticket", "")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/history?dateFrom=&dateTo=' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'apikey': "",
'apisecret': "",
'apiticket': ""
}
conn.request("GET", "/baseUrl/history?dateFrom=&dateTo=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/history"
querystring = {"dateFrom":"","dateTo":""}
headers = {
"apikey": "",
"apisecret": "",
"apiticket": ""
}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/history"
queryString <- list(
dateFrom = "",
dateTo = ""
)
response <- VERB("GET", url, query = queryString, add_headers('apikey' = '', 'apisecret' = '', 'apiticket' = ''), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/history?dateFrom=&dateTo=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["apikey"] = ''
request["apisecret"] = ''
request["apiticket"] = ''
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/history') do |req|
req.headers['apikey'] = ''
req.headers['apisecret'] = ''
req.headers['apiticket'] = ''
req.params['dateFrom'] = ''
req.params['dateTo'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/history";
let querystring = [
("dateFrom", ""),
("dateTo", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("apikey", "".parse().unwrap());
headers.insert("apisecret", "".parse().unwrap());
headers.insert("apiticket", "".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/history?dateFrom=&dateTo=' \
--header 'apikey: ' \
--header 'apisecret: ' \
--header 'apiticket: '
http GET '{{baseUrl}}/history?dateFrom=&dateTo=' \
apikey:'' \
apisecret:'' \
apiticket:''
wget --quiet \
--method GET \
--header 'apikey: ' \
--header 'apisecret: ' \
--header 'apiticket: ' \
--output-document \
- '{{baseUrl}}/history?dateFrom=&dateTo='
import Foundation
let headers = [
"apikey": "",
"apisecret": "",
"apiticket": ""
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/history?dateFrom=&dateTo=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
bets:
[
{
id:"797",
typeCode:"SGL",
typeName:"Single",
transDateTime:"2016-01-05 14:27:58",
settled:false,
stake:0.12,
status:"N",
winnings:0.26,
estimatedReturns:0.26
},
{
id:"798",
typeCode:"SGL",
typeName:"Single",
transDateTime:"2016-01-05 15:27:58",
numLines:5,
numSelections:5,
receipt:"O/0001370/0000132/F",
settled:false,
stake:0.13,
cashinValue:0.12,
stakePerLine:0.13,
status:"A",
winnings:0.26,
estimatedReturns:0.26,
freeBetValue:0.00,
legs:
[
{
type:"W",
number:1,
parts:
[
{
number:1,
description:"Swansea",
eventId:"OB_EV3966",
eventDescription:"Swansea Vs Sunderland",
priceDen:1,
priceNum:1,
priceType:"L",
result:"-",
startDateTime:"2016-01-07 20:00:00"
},
{
number:1,
description:"Swansea",
eachWayNum:1,
eachWayDen:1,
eachWayPlaces:1
eventId:"OB_EV3966",
eventDescription:"Swansea Vs Sunderland",
eventMarketDescription:"90 Minutes",
eventTypeDescription:"Manchester Senior Cup",
handicap:0.1,
selectionId:"OB_OU00001",
priceDen:1,
priceNum:1,
priceType:"L",
result:"-",
startDateTime:"2016-01-07 20:00:00",
rule4Deductions:0.1,
priceFormatted:
{
fractional:"EVS",
decimal:2,
american:"+100"
}
}
]
}
]
}
]
}
GET
Returns available free bets
{{baseUrl}}/freebets
HEADERS
apiKey
apiSecret
apiTicket
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/freebets");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "apikey: ");
headers = curl_slist_append(headers, "apisecret: ");
headers = curl_slist_append(headers, "apiticket: ");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/freebets" {:headers {:apikey ""
:apisecret ""
:apiticket ""}})
require "http/client"
url = "{{baseUrl}}/freebets"
headers = HTTP::Headers{
"apikey" => ""
"apisecret" => ""
"apiticket" => ""
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/freebets"),
Headers =
{
{ "apikey", "" },
{ "apisecret", "" },
{ "apiticket", "" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/freebets");
var request = new RestRequest("", Method.Get);
request.AddHeader("apikey", "");
request.AddHeader("apisecret", "");
request.AddHeader("apiticket", "");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/freebets"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("apikey", "")
req.Header.Add("apisecret", "")
req.Header.Add("apiticket", "")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/freebets HTTP/1.1
Apikey:
Apisecret:
Apiticket:
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/freebets")
.setHeader("apikey", "")
.setHeader("apisecret", "")
.setHeader("apiticket", "")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/freebets"))
.header("apikey", "")
.header("apisecret", "")
.header("apiticket", "")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/freebets")
.get()
.addHeader("apikey", "")
.addHeader("apisecret", "")
.addHeader("apiticket", "")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/freebets")
.header("apikey", "")
.header("apisecret", "")
.header("apiticket", "")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/freebets');
xhr.setRequestHeader('apikey', '');
xhr.setRequestHeader('apisecret', '');
xhr.setRequestHeader('apiticket', '');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/freebets',
headers: {apikey: '', apisecret: '', apiticket: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/freebets';
const options = {method: 'GET', headers: {apikey: '', apisecret: '', apiticket: ''}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/freebets',
method: 'GET',
headers: {
apikey: '',
apisecret: '',
apiticket: ''
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/freebets")
.get()
.addHeader("apikey", "")
.addHeader("apisecret", "")
.addHeader("apiticket", "")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/freebets',
headers: {
apikey: '',
apisecret: '',
apiticket: ''
}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/freebets',
headers: {apikey: '', apisecret: '', apiticket: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/freebets');
req.headers({
apikey: '',
apisecret: '',
apiticket: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/freebets',
headers: {apikey: '', apisecret: '', apiticket: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/freebets';
const options = {method: 'GET', headers: {apikey: '', apisecret: '', apiticket: ''}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"apikey": @"",
@"apisecret": @"",
@"apiticket": @"" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/freebets"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
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 "{{baseUrl}}/freebets" in
let headers = Header.add_list (Header.init ()) [
("apikey", "");
("apisecret", "");
("apiticket", "");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/freebets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apikey: ",
"apisecret: ",
"apiticket: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/freebets', [
'headers' => [
'apikey' => '',
'apisecret' => '',
'apiticket' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/freebets');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'apikey' => '',
'apisecret' => '',
'apiticket' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/freebets');
$request->setRequestMethod('GET');
$request->setHeaders([
'apikey' => '',
'apisecret' => '',
'apiticket' => ''
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("apikey", "")
$headers.Add("apisecret", "")
$headers.Add("apiticket", "")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/freebets' -Method GET -Headers $headers
$headers=@{}
$headers.Add("apikey", "")
$headers.Add("apisecret", "")
$headers.Add("apiticket", "")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/freebets' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'apikey': "",
'apisecret': "",
'apiticket': ""
}
conn.request("GET", "/baseUrl/freebets", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/freebets"
headers = {
"apikey": "",
"apisecret": "",
"apiticket": ""
}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/freebets"
response <- VERB("GET", url, add_headers('apikey' = '', 'apisecret' = '', 'apiticket' = ''), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/freebets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["apikey"] = ''
request["apisecret"] = ''
request["apiticket"] = ''
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/freebets') do |req|
req.headers['apikey'] = ''
req.headers['apisecret'] = ''
req.headers['apiticket'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/freebets";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("apikey", "".parse().unwrap());
headers.insert("apisecret", "".parse().unwrap());
headers.insert("apiticket", "".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/freebets \
--header 'apikey: ' \
--header 'apisecret: ' \
--header 'apiticket: '
http GET {{baseUrl}}/freebets \
apikey:'' \
apisecret:'' \
apiticket:''
wget --quiet \
--method GET \
--header 'apikey: ' \
--header 'apisecret: ' \
--header 'apiticket: ' \
--output-document \
- {{baseUrl}}/freebets
import Foundation
let headers = [
"apikey": "",
"apisecret": "",
"apiticket": ""
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/freebets")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
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
validateBetslip
{{baseUrl}}/betslips
HEADERS
apiKey
apiSecret
BODY json
{
"legs": [
{
"parts": [
{
"includeInMultiple": false,
"priceDen": 0,
"priceNum": 0,
"priceType": 0,
"selectionId": 0
}
],
"sort": "",
"type": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/betslips");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "apikey: ");
headers = curl_slist_append(headers, "apisecret: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"legs\": [\n {\n \"parts\": [\n {\n \"includeInMultiple\": false,\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": 0,\n \"selectionId\": 0\n }\n ],\n \"sort\": \"\",\n \"type\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/betslips" {:headers {:apikey ""
:apisecret ""}
:content-type :json
:form-params {:legs [{:parts [{:includeInMultiple false
:priceDen 0
:priceNum 0
:priceType 0
:selectionId 0}]
:sort ""
:type ""}]}})
require "http/client"
url = "{{baseUrl}}/betslips"
headers = HTTP::Headers{
"apikey" => ""
"apisecret" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"legs\": [\n {\n \"parts\": [\n {\n \"includeInMultiple\": false,\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": 0,\n \"selectionId\": 0\n }\n ],\n \"sort\": \"\",\n \"type\": \"\"\n }\n ]\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/betslips"),
Headers =
{
{ "apikey", "" },
{ "apisecret", "" },
},
Content = new StringContent("{\n \"legs\": [\n {\n \"parts\": [\n {\n \"includeInMultiple\": false,\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": 0,\n \"selectionId\": 0\n }\n ],\n \"sort\": \"\",\n \"type\": \"\"\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/betslips");
var request = new RestRequest("", Method.Post);
request.AddHeader("apikey", "");
request.AddHeader("apisecret", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"legs\": [\n {\n \"parts\": [\n {\n \"includeInMultiple\": false,\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": 0,\n \"selectionId\": 0\n }\n ],\n \"sort\": \"\",\n \"type\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/betslips"
payload := strings.NewReader("{\n \"legs\": [\n {\n \"parts\": [\n {\n \"includeInMultiple\": false,\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": 0,\n \"selectionId\": 0\n }\n ],\n \"sort\": \"\",\n \"type\": \"\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "")
req.Header.Add("apisecret", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/betslips HTTP/1.1
Apikey:
Apisecret:
Content-Type: application/json
Host: example.com
Content-Length: 253
{
"legs": [
{
"parts": [
{
"includeInMultiple": false,
"priceDen": 0,
"priceNum": 0,
"priceType": 0,
"selectionId": 0
}
],
"sort": "",
"type": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/betslips")
.setHeader("apikey", "")
.setHeader("apisecret", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"legs\": [\n {\n \"parts\": [\n {\n \"includeInMultiple\": false,\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": 0,\n \"selectionId\": 0\n }\n ],\n \"sort\": \"\",\n \"type\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/betslips"))
.header("apikey", "")
.header("apisecret", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"legs\": [\n {\n \"parts\": [\n {\n \"includeInMultiple\": false,\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": 0,\n \"selectionId\": 0\n }\n ],\n \"sort\": \"\",\n \"type\": \"\"\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"legs\": [\n {\n \"parts\": [\n {\n \"includeInMultiple\": false,\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": 0,\n \"selectionId\": 0\n }\n ],\n \"sort\": \"\",\n \"type\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/betslips")
.post(body)
.addHeader("apikey", "")
.addHeader("apisecret", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/betslips")
.header("apikey", "")
.header("apisecret", "")
.header("content-type", "application/json")
.body("{\n \"legs\": [\n {\n \"parts\": [\n {\n \"includeInMultiple\": false,\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": 0,\n \"selectionId\": 0\n }\n ],\n \"sort\": \"\",\n \"type\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
legs: [
{
parts: [
{
includeInMultiple: false,
priceDen: 0,
priceNum: 0,
priceType: 0,
selectionId: 0
}
],
sort: '',
type: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/betslips');
xhr.setRequestHeader('apikey', '');
xhr.setRequestHeader('apisecret', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/betslips',
headers: {apikey: '', apisecret: '', 'content-type': 'application/json'},
data: {
legs: [
{
parts: [
{
includeInMultiple: false,
priceDen: 0,
priceNum: 0,
priceType: 0,
selectionId: 0
}
],
sort: '',
type: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/betslips';
const options = {
method: 'POST',
headers: {apikey: '', apisecret: '', 'content-type': 'application/json'},
body: '{"legs":[{"parts":[{"includeInMultiple":false,"priceDen":0,"priceNum":0,"priceType":0,"selectionId":0}],"sort":"","type":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/betslips',
method: 'POST',
headers: {
apikey: '',
apisecret: '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "legs": [\n {\n "parts": [\n {\n "includeInMultiple": false,\n "priceDen": 0,\n "priceNum": 0,\n "priceType": 0,\n "selectionId": 0\n }\n ],\n "sort": "",\n "type": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"legs\": [\n {\n \"parts\": [\n {\n \"includeInMultiple\": false,\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": 0,\n \"selectionId\": 0\n }\n ],\n \"sort\": \"\",\n \"type\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/betslips")
.post(body)
.addHeader("apikey", "")
.addHeader("apisecret", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/betslips',
headers: {
apikey: '',
apisecret: '',
'content-type': 'application/json'
}
};
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(JSON.stringify({
legs: [
{
parts: [
{
includeInMultiple: false,
priceDen: 0,
priceNum: 0,
priceType: 0,
selectionId: 0
}
],
sort: '',
type: ''
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/betslips',
headers: {apikey: '', apisecret: '', 'content-type': 'application/json'},
body: {
legs: [
{
parts: [
{
includeInMultiple: false,
priceDen: 0,
priceNum: 0,
priceType: 0,
selectionId: 0
}
],
sort: '',
type: ''
}
]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/betslips');
req.headers({
apikey: '',
apisecret: '',
'content-type': 'application/json'
});
req.type('json');
req.send({
legs: [
{
parts: [
{
includeInMultiple: false,
priceDen: 0,
priceNum: 0,
priceType: 0,
selectionId: 0
}
],
sort: '',
type: ''
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/betslips',
headers: {apikey: '', apisecret: '', 'content-type': 'application/json'},
data: {
legs: [
{
parts: [
{
includeInMultiple: false,
priceDen: 0,
priceNum: 0,
priceType: 0,
selectionId: 0
}
],
sort: '',
type: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/betslips';
const options = {
method: 'POST',
headers: {apikey: '', apisecret: '', 'content-type': 'application/json'},
body: '{"legs":[{"parts":[{"includeInMultiple":false,"priceDen":0,"priceNum":0,"priceType":0,"selectionId":0}],"sort":"","type":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"apikey": @"",
@"apisecret": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"legs": @[ @{ @"parts": @[ @{ @"includeInMultiple": @NO, @"priceDen": @0, @"priceNum": @0, @"priceType": @0, @"selectionId": @0 } ], @"sort": @"", @"type": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/betslips"]
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];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/betslips" in
let headers = Header.add_list (Header.init ()) [
("apikey", "");
("apisecret", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"legs\": [\n {\n \"parts\": [\n {\n \"includeInMultiple\": false,\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": 0,\n \"selectionId\": 0\n }\n ],\n \"sort\": \"\",\n \"type\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/betslips",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'legs' => [
[
'parts' => [
[
'includeInMultiple' => null,
'priceDen' => 0,
'priceNum' => 0,
'priceType' => 0,
'selectionId' => 0
]
],
'sort' => '',
'type' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"apikey: ",
"apisecret: ",
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/betslips', [
'body' => '{
"legs": [
{
"parts": [
{
"includeInMultiple": false,
"priceDen": 0,
"priceNum": 0,
"priceType": 0,
"selectionId": 0
}
],
"sort": "",
"type": ""
}
]
}',
'headers' => [
'apikey' => '',
'apisecret' => '',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/betslips');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'apikey' => '',
'apisecret' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'legs' => [
[
'parts' => [
[
'includeInMultiple' => null,
'priceDen' => 0,
'priceNum' => 0,
'priceType' => 0,
'selectionId' => 0
]
],
'sort' => '',
'type' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'legs' => [
[
'parts' => [
[
'includeInMultiple' => null,
'priceDen' => 0,
'priceNum' => 0,
'priceType' => 0,
'selectionId' => 0
]
],
'sort' => '',
'type' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/betslips');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'apikey' => '',
'apisecret' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("apikey", "")
$headers.Add("apisecret", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/betslips' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"legs": [
{
"parts": [
{
"includeInMultiple": false,
"priceDen": 0,
"priceNum": 0,
"priceType": 0,
"selectionId": 0
}
],
"sort": "",
"type": ""
}
]
}'
$headers=@{}
$headers.Add("apikey", "")
$headers.Add("apisecret", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/betslips' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"legs": [
{
"parts": [
{
"includeInMultiple": false,
"priceDen": 0,
"priceNum": 0,
"priceType": 0,
"selectionId": 0
}
],
"sort": "",
"type": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"legs\": [\n {\n \"parts\": [\n {\n \"includeInMultiple\": false,\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": 0,\n \"selectionId\": 0\n }\n ],\n \"sort\": \"\",\n \"type\": \"\"\n }\n ]\n}"
headers = {
'apikey': "",
'apisecret': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/betslips", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/betslips"
payload = { "legs": [
{
"parts": [
{
"includeInMultiple": False,
"priceDen": 0,
"priceNum": 0,
"priceType": 0,
"selectionId": 0
}
],
"sort": "",
"type": ""
}
] }
headers = {
"apikey": "",
"apisecret": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/betslips"
payload <- "{\n \"legs\": [\n {\n \"parts\": [\n {\n \"includeInMultiple\": false,\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": 0,\n \"selectionId\": 0\n }\n ],\n \"sort\": \"\",\n \"type\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('apikey' = '', 'apisecret' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/betslips")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = ''
request["apisecret"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"legs\": [\n {\n \"parts\": [\n {\n \"includeInMultiple\": false,\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": 0,\n \"selectionId\": 0\n }\n ],\n \"sort\": \"\",\n \"type\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/betslips') do |req|
req.headers['apikey'] = ''
req.headers['apisecret'] = ''
req.body = "{\n \"legs\": [\n {\n \"parts\": [\n {\n \"includeInMultiple\": false,\n \"priceDen\": 0,\n \"priceNum\": 0,\n \"priceType\": 0,\n \"selectionId\": 0\n }\n ],\n \"sort\": \"\",\n \"type\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/betslips";
let payload = json!({"legs": (
json!({
"parts": (
json!({
"includeInMultiple": false,
"priceDen": 0,
"priceNum": 0,
"priceType": 0,
"selectionId": 0
})
),
"sort": "",
"type": ""
})
)});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("apikey", "".parse().unwrap());
headers.insert("apisecret", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/betslips \
--header 'apikey: ' \
--header 'apisecret: ' \
--header 'content-type: application/json' \
--data '{
"legs": [
{
"parts": [
{
"includeInMultiple": false,
"priceDen": 0,
"priceNum": 0,
"priceType": 0,
"selectionId": 0
}
],
"sort": "",
"type": ""
}
]
}'
echo '{
"legs": [
{
"parts": [
{
"includeInMultiple": false,
"priceDen": 0,
"priceNum": 0,
"priceType": 0,
"selectionId": 0
}
],
"sort": "",
"type": ""
}
]
}' | \
http POST {{baseUrl}}/betslips \
apikey:'' \
apisecret:'' \
content-type:application/json
wget --quiet \
--method POST \
--header 'apikey: ' \
--header 'apisecret: ' \
--header 'content-type: application/json' \
--body-data '{\n "legs": [\n {\n "parts": [\n {\n "includeInMultiple": false,\n "priceDen": 0,\n "priceNum": 0,\n "priceType": 0,\n "selectionId": 0\n }\n ],\n "sort": "",\n "type": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/betslips
import Foundation
let headers = [
"apikey": "",
"apisecret": "",
"content-type": "application/json"
]
let parameters = ["legs": [
[
"parts": [
[
"includeInMultiple": false,
"priceDen": 0,
"priceNum": 0,
"priceType": 0,
"selectionId": 0
]
],
"sort": "",
"type": ""
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/betslips")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"betslip" : [
{
number: 1,
numLines: 1
...
}
]
}