Closed tkralj closed 5 years ago
It turned out to be my mistake. If you send POST request you have to set Content-Length header (even there is no content) for this to work.
@tkralj i am also getting similar problem can you provide your code or help me out ?
Hello. I am having a problem when sending HTTP POST requests to my server. The code is as follows:
The problem seems to be in line "https.sendHeader("api-key"). When I set this header the client times out (like in debug output below), but if i comment out this header my WebAPI endpoint returns "Not authorized" which is expected because it requires api-key to be set and valid. I am making a connection over SSL using TingyGSM module. GET requests works fine even with headers set and this same WebAPI works fine if I set it's attribute to be GET and not SET type on the IIS side. Can you help ?
Initializing modem... [7162] ### TinyGSM Version: 0.7.9 [7362] ### Unhandled: ⸮⸮ [7477] ### Modem: SIMCOM SIM800L [7477] ### Modem: SIMCOM SIM800L Modem: SIM800 R14.18 Waiting for network... OK Network connected Connecting to wm OK Performing HTTPS POST request... making POST request [22893] ### Available: 0 on 1 END POST request [26289] ### Available: 0 on 1 [27313] ### Available: 0 on 1 [28337] ### Available: 0 on 1 [29359] ### Available: 0 on 1 [30382] ### Available: 0 on 1 [31404] ### Available: 0 on 1 [32426] ### Available: 0 on 1 [33447] ### Available: 0 on 1 [34469] ### Available: 0 on 1 [35492] ### Available: 0 on 1 [36514] ### Available: 0 on 1 [37536] ### Available: 0 on 1 [38558] ### Available: 0 on 1 [39580] ### Available: 0 on 1 [40602] ### Available: 0 on 1 [41624] ### Available: 0 on 1 [42646] ### Available: 0 on 1 [43667] ### Available: 0 on 1 [44690] ### Available: 0 on 1 [45712] ### Available: 0 on 1 [46733] ### Available: 0 on 1 [47755] ### Available: 0 on 1 [48779] ### Available: 0 on 1 [49804] ### Available: 0 on 1 [50826] ### Available: 0 on 1 [51848] ### Available: 0 on 1 [52870] ### Available: 0 on 1 [53892] ### Available: 0 on 1 [54913] ### Available: 0 on 1 [55935] ### Available: 0 on 1 [56958] ### Available: 0 on 1 [57458] ### Available: 0 on 1 Response:
Server disconnected GPRS disconnected