Message Boards Message Boards

GROUPS:

URLExecute for Windows (password issue)

Posted 9 years ago
4331 Views
|
2 Replies
|
0 Total Likes
|

Hello,

I am working on Linux (Ubuntu) and I have written the following function in order to upload a JSON file (server with 'url' adress):

URLExecute[url, "BodyData" ->"{"a"->"b"}","Method" -> "PUT"]

It works fine for Linux. But it should also work on a Windows Server...

1) Is the "Method"->"PUT" based on cURL?
2) Is there another function or a workaround for Windows?

Thanks! Gordon

POSTED BY: gordon fischer
2 Replies
Posted 9 years ago

Hi again,

how can I manage to upload images (e.g. JPG or PNG) to a server?

f=Import["image.jpg","JPEG"]    
URLExecute["url", 
     "Method" -> "PUT", "BodyData" -> f, Username->"...", Password->"..."]

does not work:

General::erropts: The value XXX specified for the option BodyData is invalid.

The uplaod with cURL is possible (webdav is installed)

Thanks! Gordon

POSTED BY: gordon-fischer
Posted 9 years ago

Hello,

I think the key is the username/password restriction (maybe Windows is more conservative...

URLFetch[url, "BodyData" ->"{"a"->"b"}","Method" -> "PUT", "Username"->"...", "Password"->"..."] 

works fine. I switched to URLFetch due to MM9

Cheers! Gordon

POSTED BY: gordon fischer
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract