func modifierFromJSON(b []byte) (*parse.Result, error) {
	msg := &modifierJSON{}
	if err := json.Unmarshal(b, msg); err != nil {
		return nil, err
	}
	mod := NewModifier(msg.Body, msg.ContentType)
	return parse.NewResult(mod, msg.Scope)
}
modifierFromJSON takes a JSON message as a byte slice and returns a
body.Modifier and an error.

Example JSON Configuration message:
{
"scope": ["request", "response"],
"contentType": "text/plain",
"body": "c29tZSBkYXRhIHdpdGggACBhbmQg77u/" // Base64 encoded body
}
package body
import (
	"bytes"
	"crypto/rand"
	"encoding/json"
	"fmt"
	"io"
	"io/ioutil"
	"mime/multipart"
	"net/http"
	"net/textproto"
	"strconv"
	"strings"
	"github.com/google/martian/v3/log"
	"github.com/google/martian/v3/parse"
)
func init() {
	parse.Register("body.Modifier", modifierFromJSON)
}
type Modifier struct {
	contentType string
	body        []byte
	boundary    string
}
type modifierJSON struct {
	ContentType string               `json:"contentType"`
	Body        []byte               `json:"body"`  
	Scope       []parse.ModifierType `json:"scope"`
}
func NewModifier(b []byte, contentType string) *Modifier {
	log.Debugf("body.NewModifier: len(b): %d, contentType %s", len(b), contentType)
	return &Modifier{
		contentType: contentType,
		body:        b,
		boundary:    randomBoundary(),
	}
}