Need help
1 my UI there are two controls one is textbox and second one is datepicker.
2 in the textbox customer can insert either invoice number which is a string format lenght 20 and secone one is SK number lenght is 16 which is also a string format.in entry textbox.other one is date from datepicker
3 i have API where i have three parameters date,invoicenumber and SKnumber.
4 i need to pass theree fields in one post method.
5 i am using post request.
6 i have one same Get method where it is similer as i am creating post request.
i need to pass three parameters additionally
for hint i am sending one Get Request please help and give me some best suggestion where i can solve this problems
i need to create PostRequest instead of GetRequest.
Please Give me a nice Solutions in coding forms
What I have tried:
public async Task<ResponseResult<PrintResponse>> FetchPrintData(string transactionId)
{
try
{
string url = $"{AppConstants.BASEURL}{string.Format(AppConstants.GetPrintReceiptUrl, transactionId)}";
var result = await restService.GetAsync<PrintResponse>(url, false);
return result;
}
catch (HttpException ex)
{
return new ResponseResult<PrintResponse>
{
ErrorMessage = ex.ErrorResponse.MoreInformation != null ? ex.ErrorResponse.MoreInformation.ToString() : ex.ErrorResponse.HttpMessage.ToString(),
ErrorCode = ex.ErrorResponse.HttpMessage,
ResponseStatus = false,
WebStatus = ex.ErrorResponse.WebStatus
};
}
catch (Exception ex)
{
return new ResponseResult<PrintResponse>
{
ErrorMessage = ex.Message,
ResponseStatus = false,
WebStatus = Status.Failed
};
}
}