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.

is no one else having this issue?? trying to extract different parts of this text to write to the database but not able to successfully part the text

could you create short video for your issue ?

When making the api call the response returned is {“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}"}}… but the next step in the flow is to use this data to create an address object and store to the database… fields1: 267 columbus ave field2: NY etc… but when I run the workflow the object is created… and none of the fields associated with this api call are added to the object

Screen Shot 2020-10-01 at 3.36.35 PM

after inspecting the wf and database… the only fields that were actually populated were the fields that were filled but user data received directly from the user when submitting the form from the post request… but no data populates from the API request to validate the address… the request field says that the content-type is plain-text not application/json…

all the fields that are null should be populated by the data which is returned by the api request… i selected those fields cia the insert data sql query… @s.alpaslan