public void postInitialize(string _object) { var statement = new xAPIStatement(null, "http://adlnet.gov/expapi/verbs/launched", launchUrl + "launch/" + launchToken); statement.actor = this.launchData.Actor; postStatement(statement); }
public void postStatement(string _verb, string _object, xAPIResult result) { var statement = new xAPIStatement(null, _verb, _object); statement.result = result; statement.actor = this.launchData.Actor; postStatement(statement); }
public void postStatement(xAPIStatement statement) { var body = statement.toString(); var content = new System.Net.Http.StringContent(body, Encoding.UTF8, "application/json"); content.Headers.Add("cookie", this.cookie.ToString()); content.Headers.Add("X-Experience-API-Version", "1.0"); try { var responseMessage = client.PostAsync(this.launchData.endpoint + "statements", content).Result; string responseText = responseMessage.Content.ReadAsStringAsync().Result; } catch (Exception e) { var s = e.Message; } }