-4

im new in mvc. What im thinking about: the project is about to send phonenumbers to website and get informations about this number. I want to send many phonenumbers to a website (or many) ,and get informations about these numbers.And show the results in the View. im so confused about: should i make the "requset and response" in the "Controller" and send the resultes to the view to show?.Or should i send my numbers to the "View" and do all the process there?. Any help with codes?

Bravo
  • 7
  • 8

1 Answers1

1

You don't do business logic in views.

Depending on how "layered" you want your code to be, you perform the HTTP requests to external websites either in your controller, or in a separate class that you call from your controller.

How to do so is explained in many Q&As, like HttpClient vs HttpWebRequest, .NET HttpClient. How to POST string value?, What difference is there between WebClient and HTTPWebRequest classes in .NET?, and so on.

Community
  • 1
  • 1
CodeCaster
  • 147,647
  • 23
  • 218
  • 272