Q:

Is it possible to invoke rest api from web service .asmx?

I am having legacy code written in web service. I have to call third party rest api from DAL which below the web service.
Also we have dot net framework 4.0 which does not support httpclient.
Plesae let me know is it possible to do that?

A:

Yup, that's possible. Have a look at the WebRequest class or the HttpWebRequest class
Example (taken from the first linked article):  
// Create a request for the URL.        
WebRequest request = WebRequest.Create("http://www.contoso.com/default.html");
// If required by the server, set the credentials.
request.Credentials = CredentialCache.DefaultCredentials;
// Get the response.
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
// Display the status.
Console.WriteLine(response.StatusDescription);
// Get the stream containing content returned by the server.
Stream dataStream = response.GetResponseStream();
// Open the stream using a StreamReader for easy access.
StreamReader reader = new StreamReader(dataStream);
// Read the content.
string responseFromServer = reader.ReadToEnd();
// Display the content.
Console.WriteLine(responseFromServer);
// Cleanup the streams and the response.
reader.Close();
dataStream.Close();
response.Close();

