NetTalk Central

Author Topic: Read Raw data from a POST  (Read 3799 times)

Edwin Hannan

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • Email
Read Raw data from a POST
« on: June 25, 2015, 07:00:18 AM »
Hi All

I am using C8 and NT7.4

This is linked to my recent xml question

I have just been informed that a Lead Provider will be posting the data as is (and not formatting into xml or json)

How do I get this data so I can parse it

Please advise

Many thanks

Ed
Edwin Hannan

Stu

  • Hero Member
  • *****
  • Posts: 510
    • View Profile
    • Email
Re: Read Raw data from a POST
« Reply #1 on: June 25, 2015, 03:01:10 PM »
Hi Ed,

I guess my first thought is .. What does "as is" mean.

The data has to be in _some_ format, because it's data.

So before worrying about how to parse the data, first get an idea of what format the data will be in.

Then parsing. It would depend again .. Are they posting to a webservice you have created? Or are they putting the data somewhere and you are supposed to retrieve it?

If the second, and it's a web service/page, then check out http://capesoft.com/docs/NetTalk8/NetTalk3.htm#NetWebClient_Methods.

I imagine being a "Lead Provider" they are going to be putting the data somewhere and you retrieving it (either by a webservice or ftp or something).

Hope that helps,

Stu
Cheers,

Stu Andrews

Edwin Hannan

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • Email
Re: Read Raw data from a POST
« Reply #2 on: June 26, 2015, 12:58:35 AM »
Hi Stu

Many thanks for your reply, much appreciated.

I have asked what format the data would be in (if not xml) and I was told it was just a raw post (as if this was some standard format that I should know about).

I will ask again for an example of a raw post of the data.

Is there any way I can view the data in a raw post (if I get the Lead Provider to POST to my nettalk web server, I have seen in this forum ...p_web.GetValue('_postdata_'), I would need a little guidance on how to use this and where as I am a Web 101 newbie :-)

My intention is to have my Nettalk webserver receive this data so I can then insert into my Lead Database.

Many thanks for your help

Ed


Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Read Raw data from a POST
« Reply #3 on: June 26, 2015, 06:25:15 AM »
>> I was told it was just a raw post

ok, good.

>> (as if this was some standard format that I should know about).

ha ha - In cases like this I smile and nod - everyone has to learn sometime.

when a client sends data to a server it usually does a POST. The data attached to the POST is called the PostData, and it's formatted as
parameter=value&otherparameter=anothervalue
and so on.
it's a & separated list of name-value pairs.

>> Is there any way I can view the data in a raw post

yes (although chances are you won't actually need to...)

you can get _all_ the data, for parsing yourself as

  somestring = p_web.GetValue('_postdata_')


but there's no point in doing this. Rather you can access each parameter individually using GetValue

  someString = p_web.GetValue('someParameter')

but even this may be overkill...

>> My intention is to have my Nettalk webserver receive this data so I can then insert into my Lead Database.

If you were using NetTalk 8 you can generate a procedure which he can post to that pretty much does all of this for you. Your best bet would be to join us on the webinar to see the mechanics of this. For NetTalk 7 you would use a NetWebWindow procedure, and the p_web.GetValue to parse out the request.

cheers
Bruce