I want to call this Picture bed API to upload my picture and return its link.I have translated the official instructional the page into English.And there is a example succeed to use it with Python. I want to use it in Mathematica also, but the parameter (
smfile) seem is Python image object.Such as following try.So how to make it?The
img in code is
URLExecute["https://sm.ms/api/upload", <|"Method" -> "POST", "smfile" -> img|>]
URLExecute["https://sm.ms/api/upload", <|"Method" -> "POST", "smfile" -> FromCharacterCode[ToCharacterCode[ImageData[img], "UTF-8"], "Unicode"]|>]
I think the key of failure is that
"smfile" should be a Python object but not a common Mathematica expression or maybe there are other workaround can do this.