Coder Social home page Coder Social logo

blesta_sdk's Issues

internal error 500

Hi, I'm trying to create a client via api with these code:

$response = $api->post("clients", "create", array('username'=>'[email protected]',
                                            'new_password'=>'123456',
                                            'confirm_password'=>123456',
                                            'client_group_id'=>'2',
                                            'status'=>'active',
                                            'first_name'=>'handoyo',
                                            'last_name'=>'handoyo',
                                            'email'=>'[email protected]',
                                            'custom'=>array(),
                                            'settings'=> array(
                                                'default_currency'=>'USD',
                                                'language'=>'en_us',
                                                'username_type'=>'email',
                                                'tax_id'=>'',
                                                'tax_exempt'=>''
                                            ),
                                            'send_registration_email'=>'true'

));

And I get a Internal 500 error. Did I miss some codes there? Thanks

Allow null values to be passed in post fields

When submitting a POST/PUT/DELETE API request via BlestaApi, null values and their keys are removed from the request. This is because they are filtered through http_build_query before submission.

i.e. the following cURL option is set:

curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($args));

Consider updating this to:

curl_setopt($ch, CURLOPT_POSTFIELDS, $args);

If we do not filter $args through http_build_query, null values can be submitted to the API, which will then be aware that a certain key was provided, although it has no value. This can be useful in some instances, for example, if the all keys need to be provided.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.