{"id":10431,"date":"2022-08-30T10:44:12","date_gmt":"2022-08-30T17:44:12","guid":{"rendered":"https:\/\/minisoft.com\/support\/?p=10431"},"modified":"2022-08-30T10:44:12","modified_gmt":"2022-08-30T17:44:12","slug":"best-practices-calling-json-web-services","status":"publish","type":"post","link":"https:\/\/c002.minisoft.com\/support\/best-practices-calling-json-web-services\/","title":{"rendered":"Best Practices: Calling JSON web services"},"content":{"rendered":"\n<p>NOTE: To convert a JSON file to XML, please consult the following: <a href=\"\/support\/index.php\/convert-json-to-xml-using-the-json-preprocessor\/\">Convert JSON to XML using the JSON Preprocessor<\/a><\/p>\n\n\n\n<p>Generally JSON web services should be called with the \u201cContent-Type\u201d header set to \u201capplication\/json\u201d, the \u201cContent Type\u201d field set to \u201cXML\u201d, and the \u201cCharacter Set\u201d field for the return set to \u201cUTF-8\u201d. This is because the request and response should be UTF-8. Setting the \u201cContent Type\u201d to \u201cXML\u201d ensures the request will be in UTF-8. Setting the \u201cCharacter Set\u201d ensures that eFORMz will decode the response correctly. Setting the \u201cContent-Type\u201d header to \u201capplication\/json\u201d will override the value of \u201ctext\/xml\u201d that is the default when the \u201cContent Type\u201d field is set to XML. You may have issues if the request is not UTF-8 encoded and it contains character codes between 128 and 255. Not all web services use UTF-8, so you may have to adjust.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><a href=\"https:\/\/minisoft.com\/support\/wp-content\/uploads\/2022\/08\/JSON-WS.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/minisoft.com\/support\/wp-content\/uploads\/2022\/08\/JSON-WS.png\" alt=\"\" class=\"wp-image-10432\" width=\"437\" height=\"490\" srcset=\"https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2022\/08\/JSON-WS.png 874w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2022\/08\/JSON-WS-268x300.png 268w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2022\/08\/JSON-WS-768x861.png 768w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2022\/08\/JSON-WS-134x150.png 134w\" sizes=\"(max-width: 437px) 100vw, 437px\" \/><\/a><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>NOTE: To convert a JSON file to XML, please consult the following: Convert JSON to XML using the JSON Preprocessor Generally JSON web services should be called with the \u201cContent-Type\u201d header set to \u201capplication\/json\u201d, the \u201cContent Type\u201d field set to \u201cXML\u201d, and the \u201cCharacter Set\u201d field for the return set to \u201cUTF-8\u201d. This is because [&hellip;]<\/p>\n","protected":false},"author":75,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[105,1,455,454],"tags":[774],"_links":{"self":[{"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/posts\/10431"}],"collection":[{"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/users\/75"}],"replies":[{"embeddable":true,"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/comments?post=10431"}],"version-history":[{"count":1,"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/posts\/10431\/revisions"}],"predecessor-version":[{"id":10433,"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/posts\/10431\/revisions\/10433"}],"wp:attachment":[{"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/media?parent=10431"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/categories?post=10431"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/tags?post=10431"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}