gtb: pwd change, register
This commit is contained in:
@@ -321,7 +321,40 @@ namespace Xylem.Common.Logic.SoftwareAccessHelper
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static IRestResponse PutAsJson(this Object json, String url, Action<RestRequestHeaders> headersHandler = null, Int32? timeoutMs = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
var client = new RestClient(url);
|
||||
var request = new RestRequest(Method.PUT);
|
||||
var headers = new RestRequestHeaders(request)
|
||||
{
|
||||
ContentType = "application/json",
|
||||
Accept = "application/json"
|
||||
};
|
||||
|
||||
headersHandler?.Invoke(headers);
|
||||
|
||||
if (json != null)
|
||||
{
|
||||
request.AddJsonBody(json);
|
||||
}
|
||||
|
||||
ServicePointManager.Expect100Continue = false;
|
||||
|
||||
return client.Execute(request);
|
||||
}
|
||||
catch (Exception error)
|
||||
{
|
||||
return new RestResponse
|
||||
{
|
||||
StatusCode = HttpStatusCode.InternalServerError,
|
||||
Content = error.ToString()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Web request
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user