Http.get response code -1?

No argument, it’s clearly baked into the name of the lib. What isn’t clear is the advantage of the lib being pedantic on this point.

Unless there demonstrable harm by transparently accepting and discarding http://, I’m not really buying that there’s a case for throwing a difficult to debug error resulting from a very normal copy-paste operation. If whenever I copy a web URL from my browser I must remove the http:// then this is an automatable activity and I’d much rather the system did it than I.

I see your point and don’t want to sound pedantic or come across condecending, but hostname (the actual name of the field) is not the same as a hostname with protocol identifier and while the code could easily be adapted to ignore the conflation (by the person who contributed the library by some individual and not Particle) and there would be no harm in doing so, I just feel some “harm” in taking away the need to think and be exact while coding.
Conflating and/or disolving the exact meaning of well defined terms may lead to some degradation of definition.

This is what we are currently seeing with spoken language - where people can just misapply or inflate/conflate terms to fit their own perception and build their questionable cases on that interpretation.
We don’t yet know what the future consequences of that may be but opening the door to that bears some risks IMO.
Although that’s not subject of this very forum/community, that’s my personal idea to keep speech and especially technical language as exact as possible (or return to that practice ASAP).

2 Likes

Hi,
I’m having the same problem. After a few days of runnung, the http.get response code get -1 and my requests stop working. After a soft restart of the device it works again.

We are also getting HTTP status code -1 with one of our Particle Electron modules. It is able to do the GET request successfully (with status code 200), but POST request fails with status code -1.

What is interesting is that the same code works on all of our Electron modules, but one of the Electron modules throws the error -1 in POST request (but not GET request).

This is very weird. How can such a “soft” error have a effect in different hardware?

An Interesting Update:
I found that this error occurs on Electron modules with SARA-G350 uBlox module, and does NOT occur on SARA-U270 module.

I am wondering how can this hardware difference give rise to this error!?

Hi,
thanks for contributing to my problem. I still have this problem and has not been able to trace it down.
I have arround 15 units running the same code but it usually only happens to a few of them. Usually it happens after a few days of running. Very intermittent.