Rust
Rust
Aruba Fatturazione Elettronica GetTransmissionInfoRequest
See more Aruba Fatturazione Examples
Query the status of a request.Chilkat Rust Downloads
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
let http = chilkat::Http::new();
// Implements the following CURL command:
// curl -X POST https://ws.fatturazioneelettronica.aruba.it/services/ClientRequest/GetTransmissionInfoRequest \
// -H "Accept: application/json" \
// -H "Content-Type: application/json;charset=UTF-8" \
// -d '{
// "userName" : "ARUBA0000",
// "password" : "ArubaPwd",
// "requestID" : "UYZCDNDYKQ"
// }'
// Use the following online tool to generate HTTP code from a CURL command
// Convert a cURL Command to HTTP Source Code
// Use this online tool to generate code from sample JSON:
// Generate Code to Create JSON
// The following JSON is sent in the request body.
// {
// "userName": "ARUBA0000",
// "password": "ArubaPwd",
// "requestID": "UYZCDNDYKQ"
// }
let json = chilkat::JsonObject::new();
let _ = json.update_string("userName", "ARUBA0000");
let _ = json.update_string("password", "ArubaPwd");
let _ = json.update_string("requestID", "UYZCDNDYKQ");
http.set_request_header("Content-Type", "application/json;charset=UTF-8");
http.set_request_header("Accept", "application/json");
let resp = chilkat::HttpResponse::new();
if http.http_json("POST", "https://ws.fatturazioneelettronica.aruba.it/services/ClientRequest/GetTransmissionInfoRequest", &json, "application/json", &resp).is_err() {
println!("{}", http.last_error_text());
return;
}
let sb_response_body = chilkat::StringBuilder::new();
let _ = resp.get_body_sb(&sb_response_body);
let j_resp = chilkat::JsonObject::new();
let _ = j_resp.load_sb(&sb_response_body);
j_resp.set_emit_compact(false);
println!("Response Body:");
println!("{}", j_resp.emit().unwrap_or_default());
let resp_status_code = resp.status_code();
println!("Response Status Code = {}", resp_status_code);
if resp_status_code >= 400 {
println!("Response Header:");
println!("{}", resp.header());
println!("Failed.");
} else {
println!("Success.");
}