Parsing multipart/form-data with webutils

October 29, 2014
By

(This article was first published on OpenCPU, and kindly contributed to R-bloggers)

opencpu logo

As part of a larger effort to clean up and rewrite the opencpu package, some of the more general utilities will be moved into a new, separate package called webutils. The first release of webutils is now on CRAN.

The package contains a simple http request body parser that supports application/x-www-form-urlencoded, multipart/form-data, and application/json. The multipart parser is written in pure R but surprisingly fast. Furthermore, two demo functions are included that illustrate how to host and parse simple HTML forms (with file uploads) using either rhttpd or httpuv.

library(webutils)
demo_rhttpd()
demo_httpuv()

Nothing ground breaking in a time of interactive graphics and restful data science as a service, but sometimes all you need is a simple form. I had a hard time finding a decent multipart parser for R, and this one does the job quite nicely.

To leave a comment for the author, please follow the link and comment on their blog: OpenCPU.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers


Sponsors

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)