You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Hasini Witharana <ha...@gmail.com> on 2018/08/01 19:47:58 UTC

[Dev] How to send a HTTP GET request using SlingHttpServletResponse

Hi all,

I have created a servlet extending SlingAllMethodsServlet class and inside
the doGet() method I need to send a HTTP GET request with some header
values.

Below are the values that should be sent through the request.

    url - http://localhost:8080/
    username - username
    password - abc

How to achieve this?

Thank You.
-- 
*Hasini Witharana*
Undergraduate | Department of Computer Science and Engineering
University of Moratuwa
Linkedin <https://www.linkedin.com/in/hasini-witharana-185785109/>

Re: [Dev] How to send a HTTP GET request using SlingHttpServletResponse

Posted by Robert Munteanu <ro...@apache.org>.
But shouldn't the custom authentication handler get invoked as needed
from an HTTP request? You should not need to invoke it yourself.

Robert

On Thu, 2018-08-02 at 01:39 +0530, Hasini Witharana wrote:
> Hi Robert,
> 
> I am trying to send a request after finding the username and password
> to
> the custom authentication handler.
> 
> Thank You.
> 
> On Thu, Aug 2, 2018 at 1:22 AM, Robert Munteanu <ro...@apache.org>
> wrote:
> 
> > Hi Hasini,
> > 
> > On Thu, 2018-08-02 at 01:17 +0530, Hasini Witharana wrote:
> > > Hi all,
> > > 
> > > I have created a servlet extending SlingAllMethodsServlet class
> > > and
> > > inside
> > > the doGet() method I need to send a HTTP GET request with some
> > > header
> > > values.
> > > 
> > > Below are the values that should be sent through the request.
> > > 
> > >     url - http://localhost:8080/
> > >     username - username
> > >     password - abc
> > > 
> > > How to achieve this?
> > 
> > I feel compelled to ask ... why do you need to do this?
> > 
> > Robert
> > 
> > 
> 
> 



Re: [Dev] How to send a HTTP GET request using SlingHttpServletResponse

Posted by Hasini Witharana <ha...@gmail.com>.
Hi Robert,

I am trying to send a request after finding the username and password to
the custom authentication handler.

Thank You.

On Thu, Aug 2, 2018 at 1:22 AM, Robert Munteanu <ro...@apache.org> wrote:

> Hi Hasini,
>
> On Thu, 2018-08-02 at 01:17 +0530, Hasini Witharana wrote:
> > Hi all,
> >
> > I have created a servlet extending SlingAllMethodsServlet class and
> > inside
> > the doGet() method I need to send a HTTP GET request with some header
> > values.
> >
> > Below are the values that should be sent through the request.
> >
> >     url - http://localhost:8080/
> >     username - username
> >     password - abc
> >
> > How to achieve this?
>
> I feel compelled to ask ... why do you need to do this?
>
> Robert
>
>


-- 
*Hasini Witharana*
Undergraduate | Department of Computer Science and Engineering
University of Moratuwa
Linkedin <https://www.linkedin.com/in/hasini-witharana-185785109/>

Re: [Dev] How to send a HTTP GET request using SlingHttpServletResponse

Posted by Robert Munteanu <ro...@apache.org>.
Hi Hasini,

On Thu, 2018-08-02 at 01:17 +0530, Hasini Witharana wrote:
> Hi all,
> 
> I have created a servlet extending SlingAllMethodsServlet class and
> inside
> the doGet() method I need to send a HTTP GET request with some header
> values.
> 
> Below are the values that should be sent through the request.
> 
>     url - http://localhost:8080/
>     username - username
>     password - abc
> 
> How to achieve this?

I feel compelled to ask ... why do you need to do this?

Robert