示例#1
0
        WWW GenerateWWWPost(string controller, IRequestClass dataObject, bool fullHeaders = true)
        {
            string objectString = LitJson.JsonMapper.ToJson(dataObject);

            Dictionary <string, string> headers = CreateHeaders(dataObject.ToHashable(), fullHeaders);

            headers.Add("Content-Type", "application/json");
            string urlString = string.Format("{0}api/CloudGoods/{1}", CloudGoodsSettings.Url, controller);

            byte[] body = Encoding.UTF8.GetBytes(objectString);
            return(new WWW(urlString, body, headers));
        }
        WWW GenerateWWWPost(string controller, IRequestClass dataObject, bool fullHeaders = true)
        {
            string objectString = LitJson.JsonMapper.ToJson(dataObject);

            Dictionary<string, string> headers = CreateHeaders(dataObject.ToHashable(), fullHeaders);
            headers.Add("Content-Type", "application/json");
            string urlString = string.Format("{0}api/CloudGoods/{1}", CloudGoodsSettings.Url, controller);

            byte[] body = Encoding.UTF8.GetBytes(objectString);
            return new WWW(urlString, body, headers);
        }
示例#3
0
 public Dictionary <string, string> CreatePostHeaders(IRequestClass requestObject)
 {
     return(CreateHeaders(requestObject.ToHashable()));
 }
 public Dictionary<string, string> CreatePostHeaders(IRequestClass requestObject)
 {
     return CreateHeaders(requestObject.ToHashable());
 }