private void DebugRawResponse(RequestBase request) { AddDebug("RAW Result from PAYNL"); AddDebug(request.RawResponse); }
/// <summary> /// Performs an actual request /// </summary> /// <param name="request">Specific request implementation to perform</param> /// <returns>raw response string</returns> public string PerformRequest(RequestBase request) { HttpWebRequest httprequest = PrepareRequest(request.Url, "POST"); string rawResponse = PerformRoundTrip2(httprequest, HttpStatusCode.OK, () => { using (var requestWriter = new StreamWriter(httprequest.GetRequestStream())) { //string serializedResource = resource.Serialize(); string serializedResource = request.ToQueryString(); requestWriter.Write(serializedResource); } } ); request.RawResponse = rawResponse; return rawResponse; }
private void InitRequestDebug(RequestBase request) { APISettings.InitAPI(); AddDebug(string.Format("Calling API {0} / {1}", request.Controller, request.Method)); AddDebug(string.Format("Requires TOKEN? {0}", request.RequiresApiToken)); AddDebug(string.Format("Requires SERVICEID? {0}", request.RequiresServiceId)); AddDebug("-----"); AddDebug("Initializing..."); AddDebug(string.Format("URL : {0}", request.Url)); AddDebug(string.Format("PARAMS : {0}", request.ToQueryString())); AddDebug("-----"); }