Skip to content

CURL GET

Solved General
  • hello I would like to send data to a server via get via curl and have the response output to me.

    No problem by post, but it doesn’t really work with get. Does somebody has any idea?

    // My url
    $url = "https://mydomain/index.php?packageID=".$response['packageID']."&weight=".$response['weight']."&length=".$response['length']."&width=".$response['width']."&height=".$response['height']."";
    
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url); 
    curl_setopt($ch, CURLOPT_HEADER, true); 
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
    $data = curl_exec($ch);
    
    curl_close($ch);
    
    
    print($data);
    

    I would have to get this back as a response

    {"packageId":"RT000000001AT","sortPath":""}
    
  • is working

    $curl = curl_init($url);
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    
    //for debug only!
    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
    
    $resp = curl_exec($curl);
    curl_close($curl);
    
    
    print($resp);
    
  • RiekMediaundefined RiekMedia marked this topic as a question on
  • RiekMediaundefined RiekMedia has marked this topic as solved on

Did this solution help you?
Did you find the suggested solution useful? Why not buy me a coffee? It's a nice gesture, and a great way to show your appreciation 💗

Related Topics
  • Which VPN do you currently use?

    General
    6
    4 Votes
    6 Posts
    136 Views

    @phenomlab absolutely, their step brother residing in a different Countries.

    https://surfshark.com/blog/surfshark-vs-nordvpn

  • IT tools

    General
    2
    4 Votes
    2 Posts
    56 Views

    @phenomlab That is an amazing page! Thanks for sharing that. Corentin did a great job with it.

  • Text Messaging App

    General
    37
    24 Votes
    37 Posts
    492 Views

    @phenomlab sure, it’s

    https://proton.me/family

  • Ways to find RSS feeds

    Solved General
    5
    4 Votes
    5 Posts
    97 Views

    @phenomlab thanks Mark, very valuable information as always.

  • Mongodb or Redis

    General
    29
    11 Votes
    29 Posts
    416 Views

    @Madchatthew still a great catch.

  • Sudonix Blog

    General
    8
    3 Votes
    8 Posts
    343 Views

    Yes that is very awesome and I really like that idea! Great job with thinking that up!!

  • What plugins are being used here on Sudonix?

    Solved General
    6
    5 Votes
    6 Posts
    412 Views

    @Roki-Antic Welcome! This site isn’t running Persona, but Harmony - a very heavily customised version at that. Do you have a URL where your site is currently located that is publicly accessible?

    Feel free to PM this info if you do not want to disclose here.

    Happy to help with any customisation needs.

  • Which gets more visitors

    General
    4
    1 Votes
    4 Posts
    400 Views

    @kurulumu-net

    But when the search feature works, the CPU immediately swells to 100% and the site dies.

    That sounds very much like a MySQL issue to me. I’m aware that this is an existing issue in Flarum in relation to performance, and clearly, it’s still not fixed.

    I had no idea that the NodeBB migration could be this expensive. Terrible

    Yes, exactly that. To me, it would appear that I’d need to finance the development and subsequent build of any package, then they could resell the same thing to someone else without the need for any additional effort on their part = high profit margin. The issue I have with this model is that I’d foot the (somewhat huge) bill for what amounts to a minor upgrade for me, but quite the money spinner for NodeBB.

    Here the link to that thread

    https://community.nodebb.org/post/84581