Results 1 to 40 of 123

Thread: VB6 FastCGI Server

Threaded View

  1. #11
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,454

    Re: VB6 FastCGI Server

    Quote Originally Posted by jpbro View Post
    Code:
        With po_Request.Http.QueryParameters
            For ii = 0 To .KeyCount - 1
                lo_Json.IJsonObject.AddJsonObjectByKeyValuePairs "Query" & ii+1, .KeyByIndex(ii), .ValuesByIndex(ii)
            Next ii
        End With
    End Sub
    I've just dived into your code for the first time - and am not really sure (yet), what the purpose of these special Add-Functions is,
    but the JSON-standard requires (with regards to adding "new stuff"):

    1) in case a JSON-Object is the target you want to add-to: a Key and a Value
    2) in case a JSON-Array is the target you want to add-to: only a Value (and no Key)

    Values can be "plain, Values" (like Strings, Doubles, Integers, Boolean and the null-value) -
    but also "Node-Values" (either another JSON-Array, or another JSON-Object - both encapsulated by the cCollection-Type).

    So in that special case above, an add-method would only have to do (instead of the looping):
    Code:
      lo_Json.IJsonObject.AddToObject "QueryParams", _
                                 po_Request.Http.QueryParameters.Internal_cCollection_Clone
    To put the whole Param-List in one single call into the "MotherObject" (target-Object) under the Key "QueryParams".

    E.g. in case the target-object already contained two "plain-values" with the keys "FirstName" and "LastName" like that:
    Code:
    {
      "FirstName": "Fred",
      "LastName": "Flintstone"  
    }
    Then after the "single-line-add-call" it would e.g. contain:
    Code:
    {
      "FirstName": "Fred",
      "LastName": "Flintstone", 
      "QueryParams":{
                        "URL":"Some/Url",
                        "HTTPS":true,
                        "etc":"pp"
                    }
    }
    Olaf
    Last edited by Schmidt; Feb 12th, 2018 at 08:45 PM.

Posting Permissions

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



Click Here to Expand Forum to Full Width