A PHP Error was encountered

Severity: Notice

Message: Undefined index: HTTP_ACCEPT_LANGUAGE

Filename: core/MY_Controller.php

Line Number: 258

Backtrace:

File: /home/lourenss/www/pingen_www/application/core/MY_Controller.php
Line: 258
Function: _error_handler

File: /home/lourenss/www/pingen_www/application/core/MY_Controller.php
Line: 54
Function: get_browser_language

File: /home/lourenss/www/pingen_www/application/controllers/Api.php
Line: 7
Function: __construct

File: /home/lourenss/www/pingen_www/index.php
Line: 316
Function: require_once

Pingen | Send Letters Online for Private, Business and Software Developers

Example for C#

Upload and transfer a document

public SendDocToPingenResponse SendDocToPingen(string pathToPdf, bool sendViaPost = false) {

	if (string.IsNullOrEmpty(pathToPdf)) throw new ArgumentException("pathToPdf");
	if (!File.Exists(pathToPdf)) throw new ArgumentException(pathToPdf + "does not exist.");

	byte[] rawdata = File.ReadAllBytes(pathToPdf);
	string filename = Path.GetFileName(pathToPdf);

	var body = new {
		send = sendViaPost,
		speed = 1,
		color = 0,
		duplex = 0,
		rightaddress = 0,
		envelope = 0
	};

	var jsonBody = new System.Web.Script.Serialization.JavaScriptSerializer().Serialize(body);

	SendDocToPingenResponse result = null;

	using (HttpClient client = new HttpClient()) {
		var content = new MultipartFormDataContent() { };
		content.Add(new StringContent(jsonBody), "data");
		content.Add(new ByteArrayContent(rawdata), "file", filename);

		string uri = $"https://api.pingen.com/document/upload/token/15.......";

		try {
			var resultObject = client.PostAsync(uri, content).Result;
			var resultJson = resultObject.Content.ReadAsStringAsync().Result;
			result = new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize(resultJson);
		}

		catch (Exception ex) {
			/// somethign went wrong
		}

		return result;
	}
}

public class SendDocToPingenResponse {

	public bool error {
		get;
		set;
	}

	public int errorcode {
		get;
		set;
	}

	public string errormessage {
		get;
		set;
	}

	public int id {
		get;
		set;
	}
}

Credit for the example goes to Piotr Galek, thanks a lot!