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

  • SEARCH
  • Home
  • 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 8631261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:11:42+00:00 2026-06-12T09:11:42+00:00

I’m trying to load URLs using Coral CDN but I could not make it

  • 0

I’m trying to load URLs using Coral CDN but I could not make it work if I use my own context resource.

<?php
$url = 'http://www.stackoverflow.com/';
echo substr(htmlentities(file_get_contents($url)),0,100); // works OK

echo '<hr />';

$url = 'http://www.stackoverflow.com.nyud.net/'; // CORAL content distribution network
echo substr(htmlentities(file_get_contents($url)),0,100); // works OK

echo '<hr />';

$options = array(
      'http'=>array(
        'method'=>"POST",
        'header'=>
            "Host: www.stackoverflow.com.nyud.net\r\n".
            "Connection: keep-alive\r\n".
            "Content-Length: 3\r\n".
            "Cache-Control: max-age=0\r\n".
            "Origin: http://www.stackoverflow.com.nyud.net\r\n".
            "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1\r\n".
            "Content-Type: application/x-www-url-form-encoded\r\n".
            "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n".
            "Accept-Encoding: gzip,deflate,sdch\r\n".
            "Accept-Language: en-US,en;q=0.8\r\n".
            "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3",
         'content'=>'a=1'
    ));
$context = stream_context_create($options);
echo file_get_contents($url,false,$context); // 405 error?
?>

This is the actual error I get:

Warning: file_get_contents(http://www.stackoverflow.com.nyud.net/) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 405 in C:\…\lab\php-exec\index.php(4) : eval()’d code on line 29

I know curl might work but I insist to use file_get_contents(), how do you think can I solve this problem?

Thanks!

  • 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-12T09:11:43+00:00Added an answer on June 12, 2026 at 9:11 am

    Well, I think you just can’t send a POST request to *.nyud.net website, see a basic post.

    Request:

    POST / HTTP/1.1
    Host: www.stackoverflow.com.nyud.net
    Accept: */*
    Content-Length: 3
    Content-Type: application/x-www-form-urlencoded
    
    a=1
    

    Response:

    HTTP/1.0 405
    date: Thu, 04 Oct 2012 21:53:32 GMT
    server: CoralWebPrx/0.1.20 (See http://coralcdn.org/)
    content-type: text/html
    connection: close
    

    Which seems to be normal because it acts as a CDN for any website, no mater if the website is ok or not.

    Since a POST request means you want to submit something to the website, to create, update, or what ever, CoralCDN can’t handle it because it can’t submit something to an other website on its behalf. It could be a security issue. Nobody can POST what ever they want to a website anonymously…

    If you want to send a parameter to the request, put them in the url (GET request are OK) but there won’t be any solution to send a POST request to CoralCDN, even using cURL.

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
This could be a duplicate question, but I have no idea what search terms
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the

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.