1

I want to integrate web api of RazorPay by which I will get the bank details by providing the IFSC code.

I have a code which works fine in ASP.Net Core but not working in ASP.Net 4.7.

ASP.Net core code:

using (var httpClient = new HttpClient())
{
  using (var response = await httpClient.GetAsync($"https://ifsc.razorpay.com/{ifsc}"))
  {
    string apiResponse = await response.Content.ReadAsStringAsync();
    bank = JsonConvert.DeserializeObject<BankModel>(apiResponse);
  }
}
}

Source URL: https://www.techstackexperts.com/2020/05/complete-example-of-razorpay-api-to-get.html?showComment=1609738264273#c1227651246871561148

in Response.Content I am getting an error. Please advise, asp.net relevant code for the same.

Kols
  • 3,641
  • 2
  • 34
  • 42
Gyan Guru
  • 11
  • 1
  • getting error in Response.Content Error is: HttpResponseBase does not contain a definition for Content and no accessible extension method 'Content' accepting a first argument of HttpResponseBase could be found. you are missing a using directive or an assembly reference. – Gyan Guru Jan 04 '21 at 05:59
  • You are missing assembly reference or use incorrect assembly, please view whether the references contains `System.Net.Http`. – Karney. Jan 05 '21 at 07:31
  • yes, I corrected the assembly reference. Now issue is my jquery able to call the function in controller but showing parameter as null, I debug the jquery code and found that value is there but when it is calling controller function function show null in value. – Gyan Guru Jan 05 '21 at 15:32
  • How do you send the request, and how the bakend receive the value? – Karney. Jan 06 '21 at 01:58

0 Answers0