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
http://o8aucf9ny.bkt.clouddn.com/2016-10-14-17-53-00.png
Try one:
URLExecute["https://sm.ms/api/upload", <|"Method" -> "POST",
"smfile" -> img|>]
Try two:
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.