Releases v1.1.0

### Releases v1.1.0

1. Add HTTP PUT, PATCH, DELETE and HEAD methods. Check [Add support for sending PUT, PATCH, DELETE request](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/issues/5)
2. Add Table of Contents
3. Add Version String
This commit is contained in:
Khoi Hoang
2020-12-23 17:35:01 -05:00
committed by GitHub
parent ccad41d7a5
commit e7dabe52bc
27 changed files with 856 additions and 146 deletions

View File

@@ -17,13 +17,14 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Version: 1.0.2
Version: 1.1.0
Version Modified By Date Comments
------- ----------- ---------- -----------
1.0.0 K Hoang 14/09/2020 Initial coding to add support to STM32 using built-in Ethernet (Nucleo-144, DISCOVERY, etc).
1.0.1 K Hoang 09/10/2020 Restore cpp code besides Impl.h code.
1.0.2 K Hoang 09/11/2020 Make Mutex Lock and delete more reliable and error-proof
1.1.0 K Hoang 23/12/2020 Add HTTP PUT, PATCH, DELETE and HEAD methods
*****************************************************************************************************************************/
#include "AsyncHTTPRequest_Debug_Generic.h"
@@ -111,6 +112,7 @@ bool AsyncHTTPRequest::open(const char* method, const char* URL)
_contentRead = 0;
_readyState = readyStateUnsent;
if (strcmp(method, "GET") == 0)
{
_HTTPmethod = HTTPmethodGET;
@@ -119,9 +121,28 @@ bool AsyncHTTPRequest::open(const char* method, const char* URL)
{
_HTTPmethod = HTTPmethodPOST;
}
// New in v1.1.0
else if (strcmp(method, "PUT") == 0)
{
_HTTPmethod = HTTPmethodPUT;
}
else if (strcmp(method, "PATCH") == 0)
{
_HTTPmethod = HTTPmethodPATCH;
}
else if (strcmp(method, "DELETE") == 0)
{
_HTTPmethod = HTTPmethodDELETE;
}
else if (strcmp(method, "HEAD") == 0)
{
_HTTPmethod = HTTPmethodHEAD;
}
//////
else
return false;
if (!_parseURL(URL))
{
return false;
@@ -590,13 +611,19 @@ bool AsyncHTTPRequest::_buildRequest()
return false;
}
_request->write(_HTTPmethod == HTTPmethodGET ? "GET " : "POST ");
// New in v1.1.0
_request->write(_HTTPmethodStringwithSpace[_HTTPmethod]);
//////
_request->write(_URL->path);
_request->write(_URL->query);
_request->write(" HTTP/1.1\r\n");
AHTTP_LOGDEBUG3(_HTTPmethod == HTTPmethodGET ? "GET " : "POST ", _URL->path, _URL->query, " HTTP/1.1\r\n" );
// New in v1.1.0
AHTTP_LOGDEBUG3(_HTTPmethodStringwithSpace[_HTTPmethod], _URL->path, _URL->query, " HTTP/1.1\r\n" );
//////
SAFE_DELETE(_URL)
_URL = nullptr;