Api response returns plain/text instead of json

@JonL @patrick @Teodor @George @ben
I understand there are many updates happening but can someone offer some guidance to this issue??
does anyone know how to properly handle serverside api resquest/response when the response is plain/text.

api request fetch schema returned by wappler is as follows:

{
“_declaration”: {
“_attributes”: {
“version”: “1.0”,
“encoding”: “UTF-8”
}
},
“AddressValidateResponse”: {
“Address”: {
“_attributes”: {
“ID”: “0”
},
“Address2”: {
“_text”: “# 2”
},
“Address1”: {
“_text”: “267 COLUMBUS AVE”
},
“City”: {
“_text”: “NEW YORK”
},
“State”: {
“_text”: “NY”
},
“Zip5”: {
“_text”: “10023”
},
“Zip4”: {
“_text”: “2904”
}
}
}
}

and the structure is below:


when making the actual request the response is as follows when inspected in the browser with chrome dev tools

{“verifyAddress”:{“status”:200,“headers”:{“content-length”:“705”,“content-type”:“text/plain; charset=utf-8”,“request-context”:“appId=cid-v1:31e8f586-5343-4d41-a0cf-1fc2a950e1d2”,“date”:“Thu, 01 Oct 2020 16:00:45 GMT”,“connection”:“close”},“data”:"{\n “_declaration”: {\n “_attributes”: {\n “version”: “1.0”,\n “encoding”: “UTF-8”\n }\n },\n “AddressValidateResponse”: {\n “Address”: {\n “_attributes”: {\n “ID”: “0”\n },\n “Address1”: {\n “_text”: “# 2”\n },\n “Address2”: {\n “_text”: “267 COLUMBUS AVE”\n },\n “City”: {\n “_text”: “NEW YORK”\n },\n “State”: {\n “_text”: “NY”\n },\n “Zip5”: {\n “_text”: “10023”\n },\n “Zip4”: {\n “_text”: “2904”\n }\n }\n }\n}"}}

Whats the proper way to parse this response server side so that the address can be extracted…(267 COLUMBUS AVE) in this example address2: 267 COLUMBUS AVE.

Community Page
Last updated: