Demo entry 6695252

   

Submitted by junyi on Jan 23, 2018 at 08:07
Language: JavaScript. Code size: 907 Bytes.

$.ajax({
				type: "GET",
				url: "/bpmworkflowruntime/v1/xsrf-token",
				headers: {
					"x-csrf-token": "Fetch"
				},
				success: function(data, statusText, xhr) {
					var token = xhr.getResponseHeader("X-CSRF-Token");

					$.ajax({
						type: "POST",
						url: "/bpmworkflowruntime/v1/workflow-instances",
						data: context,
						headers: {
							"x-csrf-token": token
						},
						success: function() {
							sap.m.MessageToast.show("Your user creation request has been submitted for approval!");
						},
						error: function(errMsg) {
							sap.m.MessageToast.show("XSRF token request didn't work: " + errMsg.statusText);
						},
						dataType: "json",
						contentType: "application/json"
					});
				},
				error: function(errMsg) {
					sap.m.MessageToast.show("Didn't work: " + errMsg.statusText);
				},
				contentType: "application/json"
			})

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).