415 Unsupported Media Type error while uploading

205 Views Asked by At

I am getting the above error while trying upload file using API. As mentioned in other queries similar to this i have set the content type as "application\json". Since it is upload i have tried with content-type as "multipart/form-data" as well which then returns “400 Bad Request”. I tried this in postman with JSON body as below for the oracle API for upload to JDE Media Object "v2/file/upload" :

{
    "deviceName": "MyDevice",
    "ssoEnabled": false,
    "moStructure": "ABGT",
    "moKey": [
        "7500"
    ],
    "formName": "P57CW05_W57CW05A",
    "version": "ZJDE0001",
    "file": {
        "fileName": "temp.pdf",
        "fileLocation": "C:\\temp.pdf",
        "itemName": "Uploaded File APIs",
        "sequence": 0
    }
}
0

There are 0 best solutions below