R/get_boundary.R

Defines functions get_boundary

get_boundary <- function(content_type){
  # Check for multipart
  if(!grepl("multipart/form-data; boundary=", content_type, fixed = TRUE))
    stop("Content type is not multipart/form-data: ", content_type)

  # Extract bounary
  content_type <- sub("content-type: ?", "", content_type, ignore.case = TRUE)
  sub("multipart/form-data; boundary=", "", content_type, fixed = TRUE)
}

Try the webutils package in your browser

Any scripts or data that you put into this service are public.

webutils documentation built on June 24, 2017, 1:02 a.m.