2017-07-26 46 views
0

我嘗試通過REST APIRESTAPI OrientDB創建文件Base64編碼的問題

發佈一個簡單的文件到我的服務器OrientDB(v2.2.22),但我收到一個500,這裏是我送的身體,

{ 
    "@class": "Student", 
    "firstName": "Gilles", 
    "lastName": "Bodart", 
    "dateOfBirth": "1992-04-14", 
    "sexe": "M" 
} 

而這裏的響應

{ 
    "errors": [ 
     { 
      "code": 500, 
      "reason": 500, 
      "content": "com.orientechnologies.orient.core.exception.OSerializationException: Error on unmarshalling JSON content for record: \"@class\":\"Student\",\"firstName\":\"Benjamin\",\"lastName\":\"Leroy\",\"dateOfBirth\":\"1992-10-31\",\"sexe\":\"M\"\r\n\tDB name=\"Memoire\"\r\n--> com.orientechnologies.common.io.OIOException: Bad Base64 input character decimal 45 in array position 4" 
     } 
    ] 
} 

這似乎是wirh日期的問題,但我把它像一個字符串。

在我的架構,它是類型化的定製,我不relly知道爲什麼,但我不能將其修改爲String

誰能幫助我?

回答

0

要嘗試你的情況我用郵差和它的作品對我來說,我只加幾行:

{"transaction": false , "operations":[ 
    { "type": "c", 
     "record" : { 
      "@class" : "Student", 
      "firstName": "Gilles", 
      "lastName": "Bodart", 
      "dateOfBirth": "1992-04-14", 
      "sexe": "M" 
     } 
    } 
]} 

這是請求:

enter image description here

,這是什麼我得到:

enter image description here

正如你所看到的出生日期類型是STRING

希望它可以幫助

問候

+0

感謝這個解決方案,事實上,我刪除了類型的自定義的屬性,我不知道爲什麼?但是這個解決方案也適用! –