Exemplo n.º 1
0
    private const string url = "http://localhost:10302/"; // + GameService.svc/Login

    public void Post(string uri, TRequest data, OnSuccessResponseDelegate onSuccessResponse, OnErrorResponseDelegate onErrorResponse, bool usingActivityIndicator = true)
    {
        var request = new HTTPRequest(new Uri(url + uri), HTTPMethods.Post, OnRequestFinished);

        request.RawData = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(data));
        request.Send();

        this.onSuccessResponse      = onSuccessResponse;
        this.onErrorResponse        = onErrorResponse;
        this.usingActivityIndicator = usingActivityIndicator;

        if (usingActivityIndicator)
        {
            // 처리 중 인디케이트 처리
        }
    }
Exemplo n.º 2
0
 public void AuthPost(string uri, TRequest data, OnSuccessResponseDelegate onSuccessResponse, OnErrorResponseDelegate onErrorResponse, bool usingActivityIndicator = true)
 {
     data.authInfo = ServiceAuthentication.authInfo;
     Post(uri, data, onSuccessResponse, onErrorResponse, usingActivityIndicator);
 }