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 7567337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:38:28+00:00 2026-05-30T14:38:28+00:00

This API gives me a headache.. Really can’t figure out what is wrong here..

  • 0

This API gives me a headache.. Really can’t figure out what is wrong here..

It just through back this error:

414. That’s an error.

The requested URL /compile... is too large to pr

The file $filename exists when the echo line is unescaped

Code

$Compile = new Net_minify_JS();
$Compile->script = file_get_contents($filename);
//echo $Compile->script;
$Compile->content_length = strlen($Compile->script);
echo '<pre>';
echo $Compile->get();
echo '</pre>';

class Net_minify_JS extends Net_socket {
    private $content = null;
    
    public $script = '';
    
    function get(){
        $this->url = 'closure-compiler.appspot.com';
        $this->path = '/compile?output_info=compiled_code&output_format=text&compilation_level=SIMPLE_OPTIMIZATIONS&js_code='.urlencode($this->script);
        $this->method = 'POST';
        
        $this->connect();
        $this->content = $this->get_content();
        
        $string = str_replace("\r\n", "\n", $this->content);
        
        return $string;
    }
}

class Net_socket {
    public $url = null;
    public $path = null;
    
    public $method = 'GET';
    public $content_type = 'application/x-www-form-urlencoded';
    public $content_length = 0;
    
    public $port = 80;
    public $timeout = 20;
    
    private $fp = null;
    private $response = null;
    
    function connect(){
        $this->response = null;
        
        $this->method = $this->prepare_method();
        
        if($this->fp = fsockopen($this->url, $this->port, $errno, $errstr, $this->timeout)){
            $write = "$this->method $this->path HTTP/1.1\r\n";
            $write .= "Host: $this->url\r\n";
            $write .= "Content-Type: $this->content_type\r\n";
            $write .= $this->content_length ? "Content-Length: $this->content_length\r\n":'';
            $write .= "Connection: Close\r\n\r\n";
            
            fwrite($this->fp, $write);
            
            while($line = fgets($this->fp)){
                if($line !== false) $this->response .= $line;
            }
            
            fclose($this->fp);
        }
        else{
            //echo "$errstr ($errno)<br>\n";
        }
    }
    
    function prepare_method(){
        return strtoupper($this->method);
    }
    
    function get_content(){
        $this->response = str_replace("\r\n", "\n", $this->response);
        $expl = explode("\n\n", $this->response);
        
        return $expl[1];
    }
}
  • 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-05-30T14:38:30+00:00Added an answer on May 30, 2026 at 2:38 pm

    Sounds like you’re violating the size limits. See https://developers.google.com/closure/compiler/docs/api-ref#errors for how much data is allowed.

    And, just for good measure, pass js_code in POST instead of GET.

    Edit: You’re using the POST method, but you’re still passing the arguments in the query string instead of the request body. This means they’re all visible in the server’s (and any proxies’) access logs. Even though they’re not secret, the query string is still subject to certain limitations: http://en.wikipedia.org/wiki/Query_string#Compatibility_issues

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

Sidebar

Related Questions

I just can't figure this out. I have a script that gets data from
I am fetching the TransactionList through affiliateservice api . My print_r($response) gives me this
So I'm trying to access this api https://www.clarityaccounting.com/api-docs/ using SUDS. Here is the code
I had this API that gives me all the images in my galleries. Now,
A good example is www.espacio asir.com, which gives this result: image-link: http://api.browsershots.org/png/original/50/509a78b11505752692d066f07fff6661.png I don't
So in my app, I do this: FB.api('/me', function(response) { alert(response.name); }); This gives
This is an api which gives you rank of any website.. http://apps.compete.com/sites/google.com/trended/rank/?apikey=ee39792b8044f3d3b8bf38f6e1ec91fd&latest=1 I do
So I have this Foursquare API..When I hit it on my browser it gives
For the life of me I can not figure out how to access the
Given this C API declaration how would it be imported to C#? int _stdcall

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.