NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: walter.dasilva on September 11, 2017, 01:12:44 PM

Title: netwebclient.textonly problem consuming WS that return json
Post by: walter.dasilva on September 11, 2017, 01:12:44 PM
Try it with netdemo.exe

https://viacep.com.br/ws/12511320/json/

check and uncheck textonly

thanks


Title: Re: netwebclient.textonly problem consuming WS that return json
Post by: Bruce on September 11, 2017, 10:27:47 PM
Hi Walter,

TextOnly is used on HTML pages to remove the HTML and extract just the text from the page.

Your server is returning JSON, not HTML, so you shouldn't be calling TextOnly anyway.
(and you shouldn't - because it will alter the returned JSON if it contains extra spaces.)

That said, I've reviewed the method for 10.07 and I think perhaps it is a little agressive. It's currently set to remove punctuation - which I think is probably excessive for what's it's used for. So I've tweaked that so the punctuation remains.

Cheers
Bruce


Title: Re: netwebclient.textonly problem consuming WS that return json
Post by: walter.dasilva on September 12, 2017, 10:27:35 AM
Hi Bruce,

Just for my knowledge.

I just want to remove the header and the test i've made with demo nt9.xx its works for me. The problem start from NT 10. so, is there a method that return just the content with no header?

Cheers
Walter
Title: Re: netwebclient.textonly problem consuming WS that return json
Post by: Bruce on September 12, 2017, 09:28:51 PM
if you call

  net.removeheader()

then the header part is removed from

net.thispage

Is that what you are trying to do?

cheers
Bruce
Title: Re: netwebclient.textonly problem consuming WS that return json
Post by: walter.dasilva on September 13, 2017, 05:30:03 AM
Hi Bruce,

No, normally i getting Header length and removing it from thispage.

I'll try .removeheader

thanks
Walter