开发者

Best way to post binary data to a Scala playframework web site

I'm writing a web app in Scala using the Play framework. I'd like to be able to push some binary data to my web server from another machine I'm using to do number crunching. I'd like to do this over http. Can anyone suggest the best way to do each side? Ideas that have occurred to me so far are:

  1. Send the data up as a file upload via the usual play form processing. Nice on the (web) server side, but I'm not sure what libraries to use for pushing the data up from the (number crunching) client. In C/C++ I'd consider using Curl.

  2. Send the data up as raw POST with the binary attached and encoded appropriately. Not sure how to do either side.

I've done each of the above on several occasions in Python and C++ (although not recently enough to remember how!), but am not a web dev (but a more general sw engineer) and 开发者_开发问答have only ever had control of one side before - so have no idea what the best way to do this is.

Any thoughts appreciated.

Alex


It depends what platform (and language) you're already using for the number-crunching client part. If that 'client' is also using the Play framework (or at least has access to the libraries), then there are some very helpful tools for accessing web services; (see here also).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜