0

I am using the Fedex API for rating and when I try to get the response of the json I get very strange characters in the response for exmaple.

¿       m¿QO¿0¿¿>   :¿ ¿¿¿¿P¿@¿¿E]¿}w¿¿o¿¿¿~w¿¿¿I¿+¿\q2'3¿¿¿y¿S6¿¿¿uz,
Co¿¿¿¿&+N. j¿¿!¿G&[J¿uR¿¿¿¿¿¿¿¿¿t<^¿iA¿1l7BKf¿¿¿`[!¿{6¿ J¿¿¿L+¿¿¿¿a`¿hp¿¿¿'¿¿¿O¿¿¿w¿¿¿¿¿¿'¿¿U/,¿]w¿`¿`¿Z!¿/a¿¿?¿9¿ ¿¿!¿<  

here is my json data i am submitting

{
                "accountNumber": {
                    "value": "24839999509"
                },
                "requestedShipment": {
                    "shipper": {
                        "address": {
                            "postalCode": 90210,
                            "countryCode": "US"
                        }
                    },
                    "recipient": {
                        "address": {
                          "residential": true,
                            "postalCode": "23228-3019",
                            "countryCode": "US"
                        }
                    },
                    "pickupType": "USE_SCHEDULED_PICKUP",
                    "serviceType": "FEDEX_GROUND",
                    "rateRequestType": [
                        "ACCOUNT",
                        "LIST"
                    ],
                    "requestedPackageLineItems": [
         {
                    "groupPackageCount": 1,
                    "weight": {
                        "units": "LB",
                        "value": 6.5
                    }
         }
        ]}
        }

if i remove below from the json request I get a valid json response like normal but using the flag for some reason make it have weird characters

"residential": true,

using POSTMAN with the same json data I get a valid response even with the residential flag set

Justin
  • 5
  • 2
  • How does the response differ with and without the residential flag when you use Postman? If you can't include the full response in your question then maybe just show the difference, and the sizes of both responses. It might also be helpful to include the PL/SQL code you're using to send and receive, including the data types involved, and the character set. (I'd *guess* you have multibyte characters and are splitting something in the middle of a character, but can't tell much just from what you have shown.) – Alex Poole Mar 23 '23 at 15:59
  • @AlexPoole - in postman there is no response difference ``` http_req := utl_http.begin_request('https://apis.fedex.com/rate/v1/rates/quotes','POST','HTTP/1.1'); utl_http.set_header (http_req, 'Content-Type', 'application/json' ); utl_http.set_header (http_req, 'Content-Length', length(vJsonData)); utl_http.set_header (http_req, 'Authorization', 'Bearer ' ||vAccessToken); utl_http.write_text(http_req, vJsonData); http_resp := utl_http.get_response(http_req); utl_http.read_text(http_resp, env); utl_http.end_response(http_resp); dbms_output.put_line(env); ``` – Justin Mar 23 '23 at 17:37
  • @AlexPoole - the length of vJsonData is only 720 vJsonData is the same json as above response size is 497B – Justin Mar 23 '23 at 17:38
  • after further research it looks like the header is Content-Encoding: - gzip so i just need to figure out how to decode the gzip to text i guess – Justin Mar 24 '23 at 13:01

0 Answers0