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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:16:10+00:00 2026-06-11T17:16:10+00:00

$this->curl = curl_init(); curl_setopt($this->curl, CURLOPT_URL, ‘http://something.com/send’); curl_setopt($this->curl, CURLOPT_REFERER, ‘http://something.com’); curl_setopt($this->curl, CURLOPT_USERAGENT, ‘Mozilla/5.0 (Windows NT

  • 0
        $this->curl = curl_init();
        curl_setopt($this->curl, CURLOPT_URL, 'http://something.com/send');
        curl_setopt($this->curl, CURLOPT_REFERER, 'http://something.com');
        curl_setopt($this->curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20100101 Firefox/15.0.1');
        curl_setopt($this->curl, CURLOPT_ENCODING, 'gzip, deflate');
        curl_setopt($this->curl, CURLOPT_COOKIEFILE, dirname(__FILE__) . '/cookies.txt');
        curl_setopt($this->curl, CURLOPT_COOKIEJAR, dirname(__FILE__) . '/cookies.txt');
        curl_setopt($this->curl, CURLOPT_HTTPGET, 0);
        curl_setopt($this->curl, CURLOPT_POST, 1);
        curl_setopt($this->curl, CURLOPT_POSTFIELDS, 'name=john');
        curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, 1);
        @curl_setopt($this->curl, CURLOPT_FOLLOWLOCATION, 1);
        curl_setopt($this->curl, CURLOPT_HTTPPROXYTUNNEL, FALSE);
        curl_setopt($this->curl, CURLOPT_PROXY, $this->proxy['0']);
        curl_setopt($this->curl, CURLOPT_PROXYPORT, $this->proxy['1']);
        curl_setopt($this->curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
        curl_setopt($this->curl, CURLOPT_PROXYAUTH, CURLAUTH_BASIC);
        curl_setopt($this->curl, CURLOPT_PROXYUSERPWD, $this->proxy['2'] . ':' . $this->proxy['3']);
        curl_setopt($this->curl, CURLOPT_HEADER, 1);
        curl_setopt($this->curl, CURLINFO_HEADER_OUT, 1);
        curl_setopt($this->curl, CURLOPT_VERBOSE, 1);$this->website = curl_exec($this->curl);
        var_dump(curl_getinfo($this->curl));
        var_dump(curl_error($this->curl));
        echo $this->website;

So getinfo shows me:
GET http://something.com/send HTTP/1.1

instead of
POST http://something.com/send HTTP/1.1

It isn’t proxy fault – i’ve tried it without proxy – same result.

So why does cURL force GET ? Instead of doing normal POST request ?

  • 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-11T17:16:11+00:00Added an answer on June 11, 2026 at 5:16 pm

    The reason this is happening is because you have CURLOPT_FOLLOWLOCATION set.

    cURL is not in fact performing a GET request instead of POST, it is doing it as well. This is because the URL you are posting to uses the POST/Redirect/GET pattern, which is used by many HTTP-driven applications. It is basically a mechanism for helping to ensure than a use doesn’t accidentally perform an action twice (in a nutshell, it is a little more complex than that in reality).

    When you POST data to the server, the server processes the request and issues a redirect so it can return the relevant content, rather than simply returning it in the response to the POST request.

    To sum up, you don’t actually have a problem. Leave your code as it is, and the result on the remote server will be what you expect – as long as the request data is correct.

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

Sidebar

Related Questions

Setting up curl like this: $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$this->domain); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,3); curl_setopt($ch,CURLOPT_FAILONERROR,TRUE); curl_setopt($ch,CURLOPT_USERAGENT,Useragent); curl_setopt($ch,CURLOPT_FOLLOWLOCATION,TRUE);
This works great to get the header $imageurl = http://p.twimg.com/AW2-vIUCAAE_1FN.png; $ch = curl_init(); curl_setopt
$ch = curl_init(); //this part we set up curl curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
I got this far: :~ curl -u username:password -d status=new_status http://twitter.com/statuses/update.xml Now, how can
I'm using this code to get data using cURL $url='http://example.com/'; //URL to get content
I use curl to perform a HTTP request like this: $ch = curl_init(); $timeout
I have this type of curl statement curl -u xxx:yyy -d aaa=111 http://someapi.com/someservice I
So this is what I have so far: self::$connection = curl_init(); curl_setopt(self::$connection, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
how would i tranfoms this curl command: curl -v -u 82xxxxxxxxxxxx63e6:api_token -X GET https://www.toggl.com/api/v6/time_entries.json
how would i tranfoms this curl command: curl -v -d email=onlinecrapbox@gmail.com -d password=mypassword -X

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.