#How to use the Anonfile.com Api Correctly?

9 messages · Page 1 of 1 (latest)

whole timber
#

from the doc

{
    "status": false,
    "error": {
        "message": "The file is too large. Max filesize: 5 GiB",
        "type": "ERROR_FILE_SIZE_EXCEEDED",
        "code": 31
    }
}
#

message is inside error

#

the json is so small, its better to use struct instead of map.

#

why do you think so?

#

with map[string]interface{} you'd need to do lots of assertion.

e := result["error"].(map[string]interface{})
e["message"]
#

with struct, you dont need to guess, whats inside.

#

by guessing, i mean assertion or reflect.

whole timber
#

you could rather send the complete fixed code
no, thats spoon feeding.

#

this part if result["message"] == nil {