-
-
Notifications
You must be signed in to change notification settings - Fork 494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integer parameters - how to? #2
Comments
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: |
I've updated the RestRequest class to allow Variant parameters for 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. |
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 |
Tim,
Thanks for writing Excel-Rest, I am finding it great.
I have run into an issue, I hope you can point me in the right direction.
I want to set a parameter that is an integer, but
gives a ByRef type compile error, since postRequest is expecting strings as parameters.
If I pass myInteger as a string the web service says it cant convert test to number.
I see you have an example of
This compiles for me also (dont understand how this can work, but I have stopped asking "why" questions of Microsoft) but obviously a hard coded value is only useful in some cases.
Can you advise how to set a non string parameter?
The text was updated successfully, but these errors were encountered: