NetTalk Central

Author Topic: netwebclient.textonly problem consuming WS that return json  (Read 2988 times)

walter.dasilva

  • Sr. Member
  • ****
  • Posts: 314
  • SOFTVALE
    • MSN Messenger - walter@softvale.com.br
    • View Profile
    • SOFTVALE
netwebclient.textonly problem consuming WS that return json
« 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


Walter - SOFTVALE

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11193
    • View Profile
Re: netwebclient.textonly problem consuming WS that return json
« Reply #1 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



walter.dasilva

  • Sr. Member
  • ****
  • Posts: 314
  • SOFTVALE
    • MSN Messenger - walter@softvale.com.br
    • View Profile
    • SOFTVALE
Re: netwebclient.textonly problem consuming WS that return json
« Reply #2 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
Walter - SOFTVALE

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11193
    • View Profile
Re: netwebclient.textonly problem consuming WS that return json
« Reply #3 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

walter.dasilva

  • Sr. Member
  • ****
  • Posts: 314
  • SOFTVALE
    • MSN Messenger - walter@softvale.com.br
    • View Profile
    • SOFTVALE
Re: netwebclient.textonly problem consuming WS that return json
« Reply #4 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
Walter - SOFTVALE