Influx http listener returning 400 in script

I am using http listener v2 with influx data format to post data to telegraf on port 8125. I am running python code with python requests module to post data to 8125. When I try a post via python command line, it works fine and I get a 204 return code and am able to see the metrics posted. When I try the same in a script, I see a return code of 400 bad gateway. I am wondering whether there is any limit on the data stream that can be posted? The content type is application/octect-stream when posting. I’d appreciate help here.

Hello @ashutoash.sagar,
Welcome! It’s unlikely, but what type of throughput/ingest rate are you trying to achieve?

So in terms of char length, it’s around 300 characters, the data itself.

I got the solution. It was a data issue on my end.

@ashutoash.sagar,
Im so happy you figured it out. Sorry for the delay. Do you mind sharing what your issue was? So that others can benefit from your solution? thank you!