public HttpJsonContent(JsonKeyValuePairs json) : base() { var body = json.Stringify(); this.content = Encoding.UTF8.GetBytes(body); this.ContentType = "application/json"; }
public Jwt(JsonKeyValuePairs payload, string secret) { var header = CreateJwtHeader(); var jwt = Base64UrlEncode(header.Stringify()) + "." + Base64UrlEncode(payload.Stringify()); jwt += "." + Sign(jwt, secret); Token = jwt; }
public HttpExceptionContent(Exception ex) : base() { var inner = ExceptionHelper.GetInner(ex); var json = new JsonKeyValuePairs { { "message", inner.Message }, { "stackTrace", ExceptionHelper.GetStackTrace(inner) } }; var body = json.Stringify(); this.content = Encoding.UTF8.GetBytes(body); this.ContentType = "application/json"; }
public FetchResponse <T> Post(string url, JsonKeyValuePairs json, string authorization) { return(Fetch(url, "POST", json.Stringify(), authorization, "application/json")); }