Search code examples
pythonaiohttp

How can i send float values as post payload in aiohttp?


When i try to send a post request with one of the json in float, it shows

TypeError: Invalid variable type: mapping value should be str or int, got 77.5 ( 77.5 is the value which i want to send).


Solution

  • Try to convert it into float. Like x = float(x). It worked for me because type of x in my code was numpy.float.