代码之家  ›  专栏  ›  技术社区  ›  Gilles Bodart

RESTAPI-OrientDB创建文档Base64编码问题

  •  0
  • Gilles Bodart  · 技术社区  · 7 年前

    但我收到了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"
            }
        ]
    }
    

    在我的模式中,它是自定义类型的,我不知道为什么,但我不能将其修改为字符串

    有人能帮我吗?

    1 回复  |  直到 7 年前
        1
  •  0
  •   Michela Bonizzi    7 年前

    为了试试你的情况,我使用了Postman,它对我有效,我只添加了几行:

    {"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

    如您所见,dateOfBirth类型为STRING

    希望有帮助

    当做