func (m *DissectedRequest) FromFile(key string) multipart.File {
	file, _, _ := m.Request.FormFile(key)
	return file
}
FromFile retrieves the named file from a multipart form. The returned value is a
*UploadedFile which can be used to retrieve the file or file header.
package dissectors
import (
	"encoding/json"
	"mime/multipart"
	"net/http"
	"net/url"
	"github.com/theparanoids/ashirt-server/backend"
)
type DissectedRequest struct {
	Request     *http.Request
	bodyValues  map[string]interface{}
	urlValues   map[string]string
	queryValues url.Values
	Error       error
}
func makeDefaultRequest(r *http.Request, urlParameters map[string]string) DissectedRequest {
	return DissectedRequest{
		Request:     r,
		bodyValues:  make(map[string]interface{}),
		urlValues:   urlParameters,
		queryValues: r.URL.Query(),
		Error:       nil,
	}
}
func DissectJSONRequest(r *http.Request, urlParameters map[string]string) DissectedRequest {
	rtn := makeDefaultRequest(r, urlParameters)
	if r.Body != http.NoBody {
		if err := json.NewDecoder(r.Body).Decode(&rtn.bodyValues); err != nil {
			rtn.Error = backend.BadInputErr(err, "Invalid JSON body")
		}
	}
	return rtn
}
func DissectPlainRequest(r *http.Request, urlParameters map[string]string) DissectedRequest {
	return makeDefaultRequest(r, urlParameters)
}
func DissectFormRequest(r *http.Request, urlParameters map[string]string) DissectedRequest {
	rtn := makeDefaultRequest(r, urlParameters)
	if r.Body != http.NoBody {
		if err := r.ParseMultipartForm(5 * 1024 * 1024); err != nil {
			rtn.Error = backend.BadInputErr(err, "Unable to parse Form body")
		}
		for key, value := range r.PostForm {
			rtn.bodyValues[key] = value
		}
	}
	return rtn
}
func (m *DissectedRequest) FromBody(key string) *Coercable {
	if m.Error != nil {
		return makeErrCoercable(m)
	}
	value, found := m.bodyValues[key]
	return makeCoercable(m, key, found, value)
}
func (m *DissectedRequest) FromURL(key string) *Coercable {
	if m.Error != nil {
		return makeErrCoercable(m)
	}
	value, found := m.urlValues[key]
	return makeCoercable(m, key, found, value)
}
func (m *DissectedRequest) FromQuery(key string) *Coercable {
	if m.Error != nil {
		return makeErrCoercable(m)
	}
	value, found := m.queryValues[key]
	return makeCoercable(m, key, found, value)
}