Literally every single function, class, module, library and framework
has an API. There are a million APIs.
So you need to be more specific: what input is the function expecting,
what input are you providing? Is there a difference between what you
should be providing and what you actually do provide?
Your input JSON seems to be incomplete: there is no opening brace, so I
wonder if there is more missing.
Your sample code is mysterious to me:
what does file_object['Body'].read() return?
what does cfg.eventlog_endpoint['endpoint'] return?
HTTP status code 417 says the server cannot provide one of the features
your request is asking for:
Can you view the request that requests is actually sending to the
website? I know nothing about requests but perhaps you can see a
difference between the request made with a binary file and a text file,
and see if it is requesting too much.
You mention “insomnia”, but I don’t know what that is. Is it this?
If this is an insomnia problem, you may need to ask for help on an
insomnia forum.
this sample file is placed in S3 path (AWS) and im reading the file as input to the code .
Blockquote
file_object[‘Body’].read()
This is reading the above input file .
Blockquote
cfg.eventlog_endpoint[‘endpoint’] → THis is the endpoint that i will be hitting , where in the above JSON is the input.
Insomnia is a tool for sending POST/GET request , in this case , i select the “BINARY FILE” option and provide the above details in the header and check if the response is 200 or anything else.
There isnt any issue with the insomnia , its used for unit/system testing the endpoint and checking its response.
in the logs for the response , i observed that , while sending the request from “insomnia”, the “isBase64Encoded” is set as True . But, while sending the same through the python code i get the response as 417 and in logs observed that “isBase64Encoded” is set as False
sorry in case i havent provided detailed information in earlier post.