From bce1e578956f30b516f3a3f547eaa2611749a0c7 Mon Sep 17 00:00:00 2001 From: hhhhpaa <79140800+hhhhpaaa@users.noreply.github.com> Date: Sat, 20 Aug 2022 20:37:22 +0530 Subject: [PATCH] Fix syntax error due to argument order Fix order on the function call on example file too --- esp8266.py | 2 +- example/http-get-post/main.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/esp8266.py b/esp8266.py index d316a1c..3b3832f 100644 --- a/esp8266.py +++ b/esp8266.py @@ -459,7 +459,7 @@ def doHttpGet(self,host,path,user_agent="RPi-Pico", port=80): return 0, None - def doHttpPost(self,host,path,user_agent="RPi-Pico",content_type,content,port=80): + def doHttpPost(self,host,path,content_type,content,user_agent='RPi-Pico',port=80): """ This fucntion use to complete a HTTP Post operation diff --git a/example/http-get-post/main.py b/example/http-get-post/main.py index cdf0814..f611568 100644 --- a/example/http-get-post/main.py +++ b/example/http-get-post/main.py @@ -74,7 +74,7 @@ Going to do HTTP Post Operation with www.httpbin.org/post ''' post_json="{\"name\":\"Noyel\"}" - httpCode, httpRes = esp01.doHttpPost("www.httpbin.org","/post","RPi-Pico", "application/json",post_json,port=80) + httpCode, httpRes = esp01.doHttpPost("www.httpbin.org","/post", "application/json",post_json,"RPi-Pico",port=80) print("------------- www.httpbin.org/post Post Operation Result -----------------------") print("HTTP Code:",httpCode) print("HTTP Response:",httpRes)