Hi, Stuart
Thanks for your reply,
I tried following code, but failed.

<code>
    $data = http_build_query($data);
    $context =
        array("http"=>
          array(
            "method" => "POST",
            "content" => $data,
            //"header" => "Connection: keep-alive\r\n",
            //"deadline" => 60, // The deadline can be up to a maximum
of 60 seconds for request handlers
            "timeout" => 30 // GAE requests have a 30-second deadline
          )
        );
    $context = stream_context_create($context);

    $result = file_get_contents($url, false, $context);

</code>


Still got same warning message in gae logs.

<log>

PHP Warning:  file_get_contents(..............): failed to open
stream: Request deadline exceeded in /base/data/home/apps/.........php
on line 93

</log>


Any suggestion?



On Jun 4, 5:56 pm, Stuart Langley <slang...@google.com> wrote:
> set the timeout value in the http context to the number of seconds you want
> the deadline to be.
>
>
>
>
>
>
>
> On Tuesday, 4 June 2013 12:05:29 UTC+10, 1moretime wrote:
>
> > Thanks, Dan
>
> > I read that doc but PHP version not found.
> > would you pls give some php code?
>
> > On Jun 4, 4:16 am, Dan Holevoet <danielholev...@google.com> wrote:
> > > This is a great question for the App Engine Stack Overflow
> > > tag<http://stackoverflow.com/questions/tagged/google-app-engine>,
> > > which also conveniently happens to have an
> > > answer<
> >http://stackoverflow.com/questions/2162115/how-to-set-timeout-for-url...>for
>
> > > you!
>
> > > Thanks,
> > > Dan
>
> > > On Mon, Jun 3, 2013 at 8:20 AM, 1moretime <chengxia...@gmail.com>
> > wrote:
> > > > URL Fetch overview says:
>
> > > > You can set a deadline for a request, the most amount of time the
> > > > service will wait for a response. By default, the deadline for a fetch
> > > > is 5 seconds. The maximum deadline is 60 seconds for HTTP requests and
> > > > 10 minutes for task queue and cron job requests.
>
> > > > Now, how can i set deadline to 60-sec ?
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "Google App Engine" group.
> > > > To unsubscribe from this group and stop receiving emails from it, send
> > an
> > > > email to google-appengi...@googlegroups.com <javascript:>.
> > > > To post to this group, send email to 
> > > > google-a...@googlegroups.com<javascript:>.
>
> > > > Visit this group athttp://
> > groups.google.com/group/google-appengine?hl=en.
> > > > For more options, visithttps://groups.google.com/groups/opt_out.
>
> > > --
> > > Dan Holevoet
> > > Google Developer Relations

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


Reply via email to