$ua->get vs $ua->request

N

nntp

# Request document and parse it as it arrives
$res = $ua->request(HTTP::Request->new(GET => $url));

And this


$ua = LWP::UserAgent->new;
$response = $ua->get("$url");


Why sometimes it is us-get and sometime it is us->request?
 
B

Brian McCauley

nntp said:
# Request document and parse it as it arrives
$res = $ua->request(HTTP::Request->new(GET => $url));

And this


$ua = LWP::UserAgent->new;
$response = $ua->get("$url");

Often an API provides a shorthand mechanism to combine serveral API
calls that are frequently used together into one.

Sometimes a programmer will use the shorthand, sometimes not. Sometimes
one programmer will use it and another will not. Sometimes the
shorthand is a late addittion to the API an some calling code predates
its introduction.

To know why in any particular case you'd have to ask the programmers in
question.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,602
Members
45,185
Latest member
GluceaReviews

Latest Threads

Top