Ich habe ein Problem mit fehlenden erforderlichen Attribut für CUPS-Get-Devices. Grundsätzlich möchte ich Liste der verfügbaren Drucker mit IPP und CUPS mit https://www.npmjs.org/package/ipp erhalten.IPP fehlt Attribut auf CUPS-Get-Devices mit node.js ipp-Modul
Ich habe CUPS-Get-Devices in das Paket implementiert, da es das Attribut für das Paket nicht unterstützt, aber ich bekomme es funktioniert. Problem ist, dass die Antwort mit "status-message" antwortet: "Fehlende erforderliche Attribute". und mir die Liste der Drucker nicht geben.
var uri = "http://localhost:631"
var data = ipp.serialize({
"operation": "CUPS-Get-Printers",
"operation-attributes-tag": {
"attributes-charset": 'utf-8',
"attributes-natural-language": 'en-us',
"limit": 10
}
});
ipp.request(uri, data, function(err, res){
if(err){
return console.log(err);
}
console.log(JSON.stringify(res,null,2));
});
Die Antwort ist
{
"version": "2.0",
"statusCode": "client-error-bad-request",
"id": 67392993,
"operation-attributes-tag": {
"attributes-charset": "utf-8",
"attributes-natural-language": "en-us",
"status-message": "Missing required attributes."
}
}
Die Dokumentation sagt nichts über andere erforderliche Parameter http://www.cups.org/documentation.php/spec-ipp.html#CUPS_GET_PRINTERS
jemand, wo ist das Problem Kennt? Vielen Dank!