Here's how you GET using URLFetch :

                URLFetchService fetchService =
URLFetchServiceFactory.getURLFetchService();
URL fetchURL = null;

HTTPResponse response = null;
String responseString = null;


try {

fetchURL = new URL("http://www.google.com";);
 response = fetchService.fetch(fetchURL);

int statusCode = response.getResponseCode();

if (statusCode == HttpStatus.SC_OK) {
     responseString = new String(response.getContent());
                        }
} catch (HttpException e) {
 } catch (IOException e) {
        }



On 17 May 2011 04:53, Dennis Lo <[email protected]> wrote:

> Hi,
>
> I see.
>
> So a public backend would be:
>
>
> <backends>
>     <backend name="spider">
>         <class>B2</class>
>         <instances>5</instances>
>         <options>
>             <dynamic>true</dynamic>
>             <public>true</public>
>         </options>
>     </backend>
> </backends>
>
> Also, what is urlfetch?
> I haven't used these before.
> Do you have any blogs, tutorials with a great example which illustrates how
> I could use it to call a backend.
>
> Alternatively, if you don't have any blogs,tutorials etc, could you explain
> with some examples?
>
>
>
> On Tue, May 17, 2011 at 3:49 AM, JakeP <[email protected]> wrote:
>
>> Dennis,
>>
>> I'm still trying to figure out the best way to call the backend
>> programmatically from within GAE. The simplest way I know of is with
>> urlfetch.
>>
>> Your backend has to be marked "public" for you to be able to access it
>> via 'spider' from outside of GAE - i.e. your browser.
>>
>> Thanks for the link.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine for Java" group.
>> To post to this group, send email to
>> [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine-java?hl=en.
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>



-- 
-Nischal
+91-9920240474
twitter: NischalShetty <http://twitter.com/nischalshetty>
facebook: Nischal <http://facebook.com/nischal>

<http://www.justunfollow.com>     <http://www.buffr.com>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to