using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using NotifyWebApi.Models;
using System.Net;
using System.IO;
using System.Text;
namespace NotifyWebApi.Utils
{
public class CHttpUtil
{
HttpWebRequest m_Request;
HttpWebResponse m_Response;
CNotifyBase m_notifyBase;
public CHttpUtil()
{
if(m_notifyBase == null)
{
m_notifyBase = new CNotifyBase();
}
}
public string SendRcv(string msg, HttpHeaderIn httpSenderIn)
{
return SendRcv(Encoding.UTF8, msg, httpSenderIn);
}
public string SencRcvUpload( HttpHeaderIn httpSenderIn, string filePath,string fileName)
{
return SendRcvUpload(Encoding.UTF8, httpSenderIn, filePath, fileName);
}
public string SendRcvUpload(Encoding encoder, HttpHeaderIn httpSenderIn, string filePath,string fileName)
{
string response = string.Empty;
if (!ValidParams(httpSenderIn))
{
return null;
}
m_notifyBase.LogInfo("Url:" + httpSenderIn.Url);
//m_notifyBase.LogInfo("Method:" + httpSenderIn.Method);
//m_notifyBase.LogInfo("ContentType:" + httpSenderIn.ContentType);
//m_notifyBase.LogInfo("Msg:" + msg);
MemoryStream memStream = null;
FileStream fileStrea