GithubHelp home page GithubHelp logo

Integer parameters - how to? about vba-web HOT 3 CLOSED

vba-tools avatar vba-tools commented on August 28, 2024
Integer parameters - how to?

from vba-web.

Comments (3)

timhall avatar timhall commented on August 28, 2024

Good question Greg, let me see if I can modify the source to be a little more flexible with the parameters that are accepted. My guess is that quotes are being added to your integer value when it is sent to your service and that's why it's being rejected. I could see this being an issue with Double and Boolean as well so I'll see if I can adjust it for all of those cases.

With the library expecting strings, it will currently convert your parameter to the following for a POST request: "myInteger":"20", which is not the desired behavior. Instead it should be "myInteger":20 so this is definitely something missing from the library and I'll add it right away.

from vba-web.

timhall avatar timhall commented on August 28, 2024

I've updated the RestRequest class to allow Variant parameters for AddParameter() and AddQuerystringParameter() and have successfully tried it with the following example:

Dim PostRequest As New RestRequest
PostRequest.Method = httpPOST

PostRequest.AddParameter "Integer", 20
PostRequest.AddParameter "Double", 3.14
PostRequest.AddParameter "Boolean", True

Debug.Print PostRequest.Body
' -> {"Integer":20,"Double":3.14,"Boolean":true}

PostRequest.Method = httpGET
Debug.Print PostRequest.FormattedResource
' -> ?Integer=20&Double=3.14&Boolean=True

To update your spreadsheet, remove the existing RestRequest class and add the updated version (1.0.2). Seems to be working better now, but let me know if you have any other issues.

from vba-web.

RibeyeOnTheBone avatar RibeyeOnTheBone commented on August 28, 2024

Tim,

Not only helpful software but helpful support as well! If you are ever in London I owe you a pint.

I will test that now and revert is there are any problems.

Greg

from vba-web.

Related Issues (20)

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.