I'm still not at all sure what you're doing or why you want to do this.

But what you pointed out is just a rehashing of what I said: some
websites run JS and send AJAX requests, etc...

Let me try to decipher what you said: you want to use request bodies
to log in to your server?  That just seems strange to me, so I feel I
didn't understand your use case.

I definitely agree with Lew, you typically proxy traffic if you want
this kind of control.  Running a proxy is probably what you want to
do.  I'm not sure how easy it is to set a system wide proxy, but I've
heard it's somewhat nontrivial: can it even be done for non rooted
devices?  (I've heard it can, I figure the best way would be to edit
the iptables directly, but obviously you can't do this without root.)

So OP, I'm still not sure what your use case is: it sounds like
something that you really can't do without a proxy.

Then again, I think I'm misunderstanding what you want to do.

Kris

On Mon, Jun 24, 2013 at 11:59 AM, jrichards1...@googlemail.com
<jrichards1...@gmail.com> wrote:
> I am connected to  a seperate Web server implemented in java that basically
> handles all the requests we send through a webview.
>
> At the moment i am using gmail to test if i can send the
> login/authentication request to our webserver and let our web server pass
> this request to google or whoever and get the response and sends it back to
> the client.
>
> With current api's i cant see how i can intercept all http requests made
> inside a webview, only cat intercept URL hyperlink calls made by a user
> interacting with a website.
>
> Not all interactions in a website are standard URL hyperlinks, some run JS
> etc so android's current webview API cant intercept this. It can in theory
> intercept the resources loaded but that only gives me a URL and a webview.
> It doesnt give me the headers that were used in the request, request body?
> request type etc. These are the variables i will need to pass to our web
> server who will use all these to login and authenticate us.
>
> Thanks
>
> On Monday, June 24, 2013 4:20:50 PM UTC+1, Lew wrote:
>>
>> You can solve this more easily using a proxy tool like Charles.
>>
>> This is the sort of thing usually not done from inside the app but to test
>> the app.
>> Yes, there are apps whose main job is to handle HTTP, and they're the
>> exception,
>> but most apps want to rely on HTTP, not manage it. So as Kristopher
>> indicated, it's
>> a matter of what your use case is.
>>
>> For most situations where I've seen a need for the data you requested,
>> it's been
>> proper to use an external tool to get at the HTTP innards.
>>
>> --
>> Lew
>>
>>
>> On Monday, June 24, 2013 7:07:57 AM UTC-7, Kristopher Micinski wrote:
>>>
>>> Not as far as I know: there is no such mechanism through the API.  I
>>> haven't checked what you can get access to if you use reflection,
>>> though I also doubt you can do many tricks there either.  I don't know
>>> much about WebKit internals, so I'm not sure if this is something that
>>> would be possible.
>>>
>>> However, maybe we could help if you better explain your use case.  Are
>>> you trying to (e.g.,) make sure no bad AJAX code runs from a webpage
>>> you loaded in your app?
>>>
>>> Kris
>>>
>>> On Mon, Jun 24, 2013 at 5:48 AM, jricha...@googlemail.com
>>> <jricha...@gmail.com> wrote:
>>> > is there a way to get request and response objects from a webview?
>>> >
>>> > for requests made from some webpage running in my webview, i want to
>>> > intercept the full http request object(the headers, http method used,
>>> > http
>>> > body etc) and divert and send across that request into another channel.
>>> >
>>> > For responses received from the webview, i want to do the same and get
>>> > the
>>> > object and its properties.
>>> >
>>> > So far i have looked at the webviewClient android class which allows
>>> > you to
>>> > intercept url links executed by a webpage and intercept the resources
>>> > it
>>> > loads.
>>> >
>>> > However, what i want to intercept, is any actual http requests the
>>> > webpage
>>> > makes. is this possible in Android webview?
>>> >
>>> > thanks
>>> >
>>> > --
>>> > --
>>> > You received this message because you are subscribed to the Google
>>> > Groups "Android Developers" group.
>>> > To post to this group, send email to android-d...@googlegroups.com
>>> > To unsubscribe from this group, send email to
>>> > android-developers+unsubscr...@googlegroups.com
>>> > For more options, visit this group at
>>> > http://groups.google.com/group/android-developers?hl=en
>>> > ---
>>> > You received this message because you are subscribed to the Google
>>> > Groups
>>> > "Android Developers" group.
>>> > To unsubscribe from this group and stop receiving emails from it, send
>>> > an
>>> > email to android-developers+unsubscr...@googlegroups.com.
>>> > For more options, visit https://groups.google.com/groups/opt_out.
>>> >
>>> >
>
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-developers+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to