NetTalk Central

Author Topic: NetWebServiceMethod: JSON plus more parameters  (Read 3852 times)

Thys

  • Sr. Member
  • ****
  • Posts: 311
    • View Profile
    • Incasu
    • Email
NetWebServiceMethod: JSON plus more parameters
« on: June 14, 2017, 05:42:24 AM »
Hi,

I have a method dbAddress for normal CRUD functionality. When I do an insert (POST with content application/json in the body) for multiple records, it works fine.

But I want to pass extra values to the method as well. It only works when the values are passed in the URL, which I don't want to. When it's added to the header, it doesn't receive the value. The only option is to add it to the JSON in the body, but I can't seem to get the formatting right - can extra values be added via the JSON in the body?

The JSON in the body looks like this:

{"Address":[
   {
      "guid":"",
      "description":"First address",
      "physicaladdress":"1 Short Street, Centurion",
      "postaladdress":"P.O.Box 1234, Centurion"
   },
   {
      "guid":"",
      "description":"Second address",
      "physicaladdress":"2  Long Street, Centurion",
      "postaladdress":"P.O.Box 7, Centurion"
   }
   ]
}


Thanks
Thys
« Last Edit: June 14, 2017, 05:55:36 AM by Thys »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: NetWebServiceMethod: JSON plus more parameters
« Reply #1 on: June 20, 2017, 12:02:23 AM »
I think this one might best be discussed at the User Group webinar on Thursday Thys.
http://www.capesoft.com/accessories/NetTalkUserGroup.htm

Cheers
Bruce