Class SurveysRespondentDataEncryptClient
public class SurveysRespondentDataEncryptClient
- Inheritance
-
SurveysRespondentDataEncryptClient
- Inherited Members
Constructors
SurveysRespondentDataEncryptClient(string, HttpClient)
public SurveysRespondentDataEncryptClient(string baseUrl, HttpClient httpClient)
Parameters
baseUrlstringhttpClientHttpClient
Properties
BaseUrl
public string BaseUrl { get; set; }
Property Value
JsonSerializerSettings
protected JsonSerializerSettings JsonSerializerSettings { get; }
Property Value
- JsonSerializerSettings
ReadResponseAsString
public bool ReadResponseAsString { get; set; }
Property Value
Methods
PostAsync(string, RespondentDataCryptographyModel, CancellationToken)
Gets asynchronously the decrypted data to encrypt it
public virtual Task<string> PostAsync(string surveyId, RespondentDataCryptographyModel respondentDataModel, CancellationToken cancellationToken = default)
Parameters
surveyIdstringThe survey identifier
respondentDataModelRespondentDataCryptographyModelThe decrypted text in modeled RespondentDataCryptographyModel object format and it's, optional, initialization vector.
The model in JSON format must look like {"Iv": "XXXXXXX","Data":{"Data1":"Value1","Data2":"Value2", "Data3":"Value3"}}cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
Remarks
Request parameter keys should be capitalized, i.e, Data and Iv, otherwise it won't be validated
Exceptions
- NfieldSdkException
A server side error occurred.
ReadObjectResponseAsync<T>(HttpResponseMessage, IReadOnlyDictionary<string, IEnumerable<string>>, CancellationToken)
protected virtual Task<SurveysRespondentDataEncryptClient.ObjectResponseResult<T>> ReadObjectResponseAsync<T>(HttpResponseMessage response, IReadOnlyDictionary<string, IEnumerable<string>> headers, CancellationToken cancellationToken)
Parameters
responseHttpResponseMessageheadersIReadOnlyDictionary<string, IEnumerable<string>>cancellationTokenCancellationToken
Returns
Type Parameters
T