Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

ryano_undefined

ryano_

@ryano_
About
Posts
2
Topics
1
Groups
0
Followers
2
Following
0

Posts

Recent Best Controversial

  • [Release] plutonium-http
    ryano_undefined ryano_

    xensik
    Thanks for the feedback.
    Yeah, I knew that tho I wanted to use an easy to port library (c++ -> chai).

    I haven't put that much thoughts into it tbh. but I will look into options on making the functions like tasks/threads.
    I don't have that high hopes bc. plugins are getting loaded/injected into the running server process sooo.. yeah I probably have to switch the library.

    For now, the best use case would be to do requests at the plugin's initialization and don't mess with it too much while players are on the server.


  • [Release] plutonium-http
    ryano_undefined ryano_

    Visit this project on Github: https://github.com/ryanocf/plutonium-http


    plutonium-http

    Making it possible to do basic http GET, POST, PUT & DELETE requests within ChaiScript.
    This plugin was mainly built for Plutonium MW3.


    Download

    Download the latest release and put the plutonium-http.dll in your servers plugin folder.


    Usage

    ❗ OpenSSL is currently not supported.
    Every function returns the same Vector scheme:

    0: version // String
    1: error // String
    2: status // Int
    3: reason // String
    4: body // String
    5: headers // Map
    
    /*
     * Params
     * url: String
     * route: String
     * headers: Map
     *
     * return: Vector
     */
    http_get("http://example.com", "/route", ["header": "value"]);
    
    /*
     * Params
     * url: String
     * route: String
     * body: String
     * headers: Map
     * content_type: String
     *
     * return: Vector
     */
    http_post("http://example.com", "/route", "body", ["header": "value"], "text/plain");
    http_post("http://example.com", "/route", "param=body&format=string", ["header": "value"], "application/x-www-form-urlencoded");
    
    /*
     * Params
     * url: String
     * route: String
     * body: String
     * headers: Map
     * content_type: String
     *
     * return: Vector
     */
    http_put("http://example.com", "/route", "body", ["header": "value"], "text/plain");
    http_put("http://example.com", "/route", "param=body&format=string", ["header": "value"], "application/x-www-form-urlencoded");
    
    /*
     * Params
     * url: String
     * route: String
     * body: String
     * headers: Map
     * content_type: String
     *
     * return: Vector
     */
    http_delete("http://example.com", "/route", "body", ["header": "value"], "text/plain");
    http_delete("http://example.com", "/route", "param=body&format=string", ["header": "value"], "application/x-www-form-urlencoded");
    

    Errors

    std::array<std::string, 13> error_list = {
        "Success",
        "Unknown",
        "Connection",
        "BindIPAddress",
        "Read",
        "Write",
        "ExceedRedirectCount",
        "Canceled",
        "SSLConnection",
        "SSLLoadingCerts",
        "SSLServerVerification",
        "UnsupportedMultipartBoundaryChars",
        "Compression"
    };
    

    Any questions or problems?
    Feel free to open an issue or visit this project on Plutonium.

    Credits

    https://github.com/yhirose/cpp-httplib
    https://github.com/ChaiScript/ChaiScript
    https://github.com/xensik/plutoscript

  • 1 / 1
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate