1. Hiya,

    I see EnqueuePost is being deprecated (thanks for the heads-up), so I don't have to rush through some fixes last minute I thought I'd change my code tonight.

    I currently have this in my code:

    Code:
    webrequest.EnqueuePost(url, payload, (code, response) => ServerDetailsCallback(code, response), this);
    But I'm not sure how this is changed to accommodate the new syntax as per Wulf's announcement as the Docs haven't yet been updated and the example in the announcement wasn't clear inside my little head :)

    Any help updating this line for the new Enqueue syntax greatly appreciated, thanks in advance.


    T.
     
  2. Wulf

    Wulf Community Admin

  3. I did, but my little brain can't comprehend what this means in actual usage:

    Code:
    webrequest.Enqueue(string url, string body, Action<int, string> callback, Plugin owner, RequestMethod method = RequestMethod.GET, Dictionary<string, string> headers = null, float timeout = 0f)
    The documentation is clear on usage for EnqueuePost and I can understand that perfectly, but as it hasn't been updated I'm left with your post (and I am still grateful of the announcement) but need a better example to fully implement. Sorry :p


    T.
     
  4. Wulf

    Wulf Community Admin

    webrequest.Enqueue(url, payload, (code, response) => ServerDetailsCallback(code, response), this, RuestMethod.POST);
     
  5. Thank you sir - additionally, I hope this post will help others when the time finally comes to remove this code completely.

    :)
    [DOUBLEPOST=1510433684][/DOUBLEPOST]Balls, getting this in the compiler log:

    Code:
    [SERVER v1.0.24] Console: CoreResetLogs.cs(37,255+): error CS0103: The name `RequestMethod' does not exist in the current context
    CoreResetLogs.cs(52,157): error CS0103: The name `RequestMethod' does not exist in the current context
    In my code I've got:

    Code:
    webrequest.Enqueue(url, payload, (code, response) => ServerDetailsCallback(code, response), this, RequestMethod.POST);
    Thanks again!
     
  6. Help me, Obi-Wulf Kenobi.
     
  7. Wulf

    Wulf Community Admin

    You'd need to add the using statement for it, which should be Oxide.Core.Libraries. Visual Studio should suggest this to you if using IntelliSense.
     
  8. Superb, I don't use Visual Studio but I'm sure this thread will save you some answering in future :)