2017-09-01 73 views
0

根據KAA文件發行sendNotification時的,發送通知給KAA下面的命令,與REST API來KAA

curl -v -S -u devuser:devuser123 -F'notification={"applicationId":"3","schemaId":"20","topicId:"1","type":"USER"};type=application/json' -F [email protected]/home/richard/notification.json "http://192.168.30.27:8080/kaaAdmin/rest/api/sendNotification" 

我敢肯定的KAA服務器和通知設置的IP地址是正確的。但得到以下錯誤,

HTTP/1.1 100繼續HTTP/1.1 400錯誤的請求

任何人達到了同樣的問題,你可以請給一些線索?

+1

你可以嘗試添加-F'和'通知='像'之間的空間'curl -v -S -u devuser:devuser123 -F'notification =' –

+0

謝謝。嘗試修改,但得到相同的錯誤。 – Richard

+0

嗨,任何人都知道在哪裏解析Kaa服務器源代碼樹中的REST API? – Richard

回答

1

響應消息:400指定的通知無效

我認爲你需要檢查你的消息的風格notification.json。

我的消息的風格是{ 「消息」: 「世界,你好!」}和.avsc文件是:

{ 
    "type" : "record", 
    "name" : "Message", 
    "namespace" : "hello.world.com", 
    "fields" : [ { 
    "name" : "Message", 
    "type" : { 
     "type" : "string", 
     "avro.java.string" : "String" 
    }, 
    "displayName" : "", 
    "displayPrompt" : "" 
    } ], 
    "version" : 1, 
    "dependencies" : [ ], 
    "displayName" : "Message", 
    "description" : "" 
}