steveosoule
7/1/2015 - 7:08 PM

MivaScript - MvCall POST JSON

MivaScript - MvCall POST JSON

<!-- FROM: http://extranet.miva.com/forums/archive/index.php/t-115262.html -->
<MvCAPTURE VARIABLE = "l.json">
{
	"contacts": [{
		"email": "something@example.com",
		"first_name": "John",
		"last_name": "Doe"
	}, {
		"email": "something@example.com",
		"first_name": "John",
		"last_name": "Doe"
	}, {
		"email": "something@example.com",
		"first_name": "John",
		"last_name": "Doe"
	}]
}
</MvCAPTURE>

<MvCALL
	METHOD = "RAW"
	ACTION = "https://some.example.com/api/"
	CONTENT-TYPE = "application/json"
	HEADERS = "{ 'Authorization: xxxxxxx' $ asciichar( 13 ) $ asciichar( 10 ) }"
	FIELDS = "l.json">
		<MvEVAL EXPR = "{ s.callvalue }">
</MvCALL>