Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8418679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:23:44+00:00 2026-06-10T02:23:44+00:00

I got the following basic script who make a basic POST request (I just

  • 0

I got the following basic script who make a basic POST request (I just want to make it work, after I’ll add more stuff) :

#   Variables
$URL = 'http://******:8282/api/incoming_shipment/';

$postdata = http_build_query(
    array(
        'contract_id'       => 'Showcare-R124276',
        'shipment_from'     => 'Montréal',
        'shipment_to'       => 'Chicago',
        'shipping_time'     => '2012-08-16 14:51:01',
        'tracking_cie'      => 'Poste Canada',
        'tracking_type'     => 'Standard',
        'tracking_number'   => 'EP645 9834 123 9773'
    )
);

$opts = array('http' =>
    array(
        'method'  => 'POST',
        'header'  => 'Content-type: application/x-www-form-urlencoded',
        'content' => $postdata
    )
);

$context = stream_context_create($opts);

$result = file_get_contents($URL, FALSE, $context);

print_r($result);

The result give me :

Warning: file_get_contents(http://******:8282/api/incoming_shipment/) [function.file-get-contents]: failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in D:\Inetpub\hightechhandling\api\api_push_contract.php on line 31

Fatal error: Maximum execution time of 30 seconds exceeded in D:\Inetpub\hightechhandling\api\api_push_contract.php on line 31

But When I go to the webpage with my browser, it work perfectly. I have tryed cURL and fsocketopen but that didn’t work too. Any help please ? Thanks..

EDIT I added set_time_limit (500); and now the second error has disapear of course… but the first still remain.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T02:23:45+00:00Added an answer on June 10, 2026 at 2:23 am

    Ok, found the problem. Was sooo stupid. The problem is because the server that make the request (where the PHP file is), has a firewall enabled and the firewall allow only port 21, 22, 80, 3306 and 1433 for external request.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got the following tables: User Basic Data (unique) [userid] [name] [etc] User Collection
I got following repeating syntax and I want to keep all <h1> that is
I've got following code in my AsyncTask. The only thing I want the AsyncTask
I've got following bash script to do something for each parameter of the script
I got the following very basic template: <html> <head> </head> <body> <div> <!-- Using
I've got a very basic application that boils down to the following code: char*
I've got an MVC user control with the following basic structure: <%@ Control Language=C#
I got the basic Apache configuration more or less figured out with the guidance
I've got the following Visual Basic code: Dim L16, L23, L45, t As Double
I've got a situation, that I'm pretty sure is something basic, that I just

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.