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)
}
FromURL attempts to retrieve a field from the provided url parameters
(e.g. in POST /operation/{operation_id}, operation_id would be the URL parameter).
Returns Coercable, which can then be transformed into the desired type.
If an error has already been encountered, the resulting action is a no-op
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)
}