Results 1 to 7 of 7

Thread: anyone managed to use CreateHTTPRequest?

  1. #1

    anyone managed to use CreateHTTPRequest?

    I have tried almost every implementation of this I can think of and have got none to work.

    If anyone has a working example I would be very grateful if someone could share so I can see if I'm doing anything wrong
    https://github.com/ThePianoDentist/t...dentistdotabot Lina bot which pulls small camp when 'laning' (Aim to work on pulling and stacking bots initially)
    https://github.com/ThePianoDentist/dotabots-ml-tools Parsing data from bot games

  2. #2
    think I found my issue


    FmtStrVSNPrintf truncated to 256 without QUIET_TRUNCATION specified! String
    "http://localhost/:9200/doublepull/run?{"type":"parameter_values","values":{"damage_s pread_lane":0,"damage_spread_neutral":0,"fraction_ lane_left":0,"fraction_neutral_left":1.25,"hero_at tackdamage":53,"hero_attackrange":670,"hero_attack speed":1.20000004768"

    whilst doing
    Code:
    CreateHTTPRequest(":9200/doublepull/run?" ..tostring(JSON:encode(data)))
    so a) you cannot specify a port as the method hard-codes a slash after localhost
    b) it appears you can only send very, very short snippets of data. max length 256

    edit: I have no idea how I saw these errors. 99/100 times it just fails silently. guess I just got lucky 0_o
    Last edited by TheP1anoDentist; 03-11-2017 at 12:34 PM.
    https://github.com/ThePianoDentist/t...dentistdotabot Lina bot which pulls small camp when 'laning' (Aim to work on pulling and stacking bots initially)
    https://github.com/ThePianoDentist/dotabots-ml-tools Parsing data from bot games

  3. #3
    ...well still doesn't work.

    the exact string I am giving to CreateHTTPRequest is doublepull/run?data={"dsl":0,"dsn":0,"fll":0.6,"fnl":0.75,"ha ":50,"hm":295,"lteh":1532,"nteh":1440.54,"s":true, "tleh":0,"tneh":0}

    i've ditched the port after setting my elasticsearch to run on port 80

    `curl localhost` successfully points towards elasticsearch and returns fine. therefore has to be an issue with CreateHTTPRequest
    https://github.com/ThePianoDentist/t...dentistdotabot Lina bot which pulls small camp when 'laning' (Aim to work on pulling and stacking bots initially)
    https://github.com/ThePianoDentist/dotabots-ml-tools Parsing data from bot games

  4. #4
    if this does get fixed. Can I pre-emptively ask to also be able to specify data for POST request in request body, not just as url arguments.
    I believe the CreateHTTPRequest for custom games already has this.

    Also this may be the most sensible way to remove the max-length issue if you have a large request to send (more than 256 chars)


    (my implementation for using this data I think I've realised cant work with url arguments I can change but it'd be nice for it to just work)
    https://github.com/ThePianoDentist/t...dentistdotabot Lina bot which pulls small camp when 'laning' (Aim to work on pulling and stacking bots initially)
    https://github.com/ThePianoDentist/dotabots-ml-tools Parsing data from bot games

  5. #5
    Valve Developer
    Join Date
    Sep 2011
    Posts
    1,604
    Can you post your entire call to the code?

    I'll also up the maximum length of the string to 8k.

  6. #6
    Basic Member
    Join Date
    Dec 2016
    Posts
    28
    Not my thread, but:

    Code:
    print(CreateHTTPRequest(""))
    will print nil all the time, although I have a server running on port 80 (ncat -l 127.0.0.1 80, to be precise).
    It's a somewhat minimalistic example, but from what I read it should still work.

    Edit: Just came to mind: Could there be something wrong with "localhost" on windows systems? I believe I had some minor issues with that in the past. Not sure.
    Last edited by Justus Mea; Today at 06:33 AM.

  7. #7
    Valve Developer
    Join Date
    Sep 2011
    Posts
    1,604
    Ah, I see the issue, dumb oversight on my part.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •