Highlighted
Contributor.
Contributor.
150 views

Replacing JSON conten in request BODY

Hi All, 

I am facing difficulty in creating request which needs to be passed in below format.(See web_custom_request). I am capturing this values in two web_reg_save_param_ex variables then have to pass  but it is giving parsing error which is quite expected as it is expecting in JSON format but have not done before. Also saw some suggestion in other post of using web_reg_save_param_json but not sure how should i use it. 

Below is the response data from where i am capturing the values using correlation. If you follow colour coding you can see the two different string and why i am using two correlation to capture it and then have to pass into request body. 

{"count":1,"next":null,"previous":null,"results":[{"job_id":"d85b5d6c-cb19-11e9-af45-0699f
1baf8a2","notes":"hfh","timestamp":"2019-08-30T11:32:27.615181Z","opportunity_id":"d85b5d6
c-cb19-11e9-af45-0699f1baf8a2","programme_id":"ui-test","status":"CANCELLED","status_detai
ls":null,"details":{"bbox":{"_northEast":{"lat":51.059037680260815,"lng":-2.31923103332519
58},"_southWest":{"lat":51.03416178277285,"lng":-2.3843765258789062}},"zoom":14,"filters":
{},"collections":[{"clean":true,"custom":false,"polygon":[[51.0466,-2.34725],[51.0464,-2.3471
6],[51.0463,-2.34706],[51.0466,-2.34722],[51.0466,-2.34725]],"excluded":{},"included":{},"
collection_id":"2551577"},{"clean":true,"custom":false,"polygon":[[51.0482,-2.3568],[51.0482,
-2.35629],[51.0484,-2.35669],[51.0482,-2.3568]],"excluded":{},"included":{},"collection_id":"
2551629"},{"clean":true,"custom":false,"polygon":[[51.0483,-2.35482],[51.0482,-2.35345],[5
1.0486,-2.35345],[51.0485,-2.35425],[51.0483,-2.35482]],"excluded":{},"included":{},"clust
er_id":"2551632"},{"clean":true,"custom":false,"polygon":[[51.0455,-2.35086],[51.0451,-2.3
5052],[51.0449,-2.3503],[51.0447,-2.35],[51.0445,-2.3496],[51.0445,-2.34926],[51.0446,-2.3
4891],[51.0458,-2.34807],[51.0476,-2.34974],[51.0478,-2.35021],[51.0477,-2.35065],[51.0465
,-2.35083],[51.0455,-2.35086]],"excluded":{},"included":{},"collection_id":"2952263"}]},"manu
al_updates":

 

Below red where i have to replace with captured values, 

web_custom_request("map",
"URL=https://{abc_cloud}/api/nvnv/jdjd/",
"Method=POST",
"Resource=0",
"RecContentType=application/json",
"Referer=https://{abc__cloud}/ncncn?opportunity=d85b5d6c-cb19-11e9-af45-0699f1baf8a2",
"Snapshot=t12.inf",
"Mode=HTML",
"EncType=application/json",
"Body={\"collections\":[{\"clean\":true,\"custom\":false,\"polygon\":[[11.000,-1.111],[11.000,-1.111],[11.000,-1.111],],\"excluded\":{},\"included\":{},\"collection_id\":\"2551577\"},{\"clean\":true,\"custom\":false,\"polygon\":[[11.000,-1.111],[11.000,-1.111],[11.000,-1.111]],\"excluded\":{},\"included\":{},\"collection_id\":\"2551629\"},{\"clean\":true,\"custom\":false,\"polygon\":[[11.000,-1.111],[11.000,-1.111],[11.000,-1.111]]],\"excluded\":{},\"included\":{},\"collection_id\":\"2551632\"},{\"clean\":true,\"custom\":false,\"polygon\":[[11.000,-1.111],[11.000,-1.111],[11.000,-1.111]],\"excluded\":{},\"included\":{},\"collection_id\":\"2952263\"}],\"filters\":{},\"bbox\":{\"_East\":{\""
"lat\":51.053535,\"lng\":-2.319317},\"_West\":{\"lat\":51.039559,\"lng\":-2.384462}}}",
LAST);

0 Likes
0 Replies
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.