Skip to content

Commit

Permalink
Tabs to spaces
Browse files Browse the repository at this point in the history
Fixed formatting. Tabs to spaces (fixing previous commit).
  • Loading branch information
Randy committed May 14, 2015
1 parent 1c66120 commit 4b44568
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 18 deletions.
25 changes: 15 additions & 10 deletions HttpClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,17 +274,22 @@ void HttpClient::sendBasicAuth(const char* aUser, const char* aPassword)

void HttpClient::finishHeaders(const char* aContentType, const char* aBody)
{
if (aContentType)
sendHeader(HTTP_HEADER_CONTENT_TYPE, aContentType);

if (aBody)
sendHeader(HTTP_HEADER_CONTENT_LENGTH, strlen(aBody));

if (aContentType)
{
sendHeader(HTTP_HEADER_CONTENT_TYPE, aContentType);
}

if (aBody)
{
sendHeader(HTTP_HEADER_CONTENT_LENGTH, strlen(aBody));
}

iClient->println();

if (aBody)
iClient->println(aBody);

if (aBody)
{
iClient->println(aBody);
}

iState = eRequestSent;
}

Expand Down
16 changes: 8 additions & 8 deletions HttpClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ class HttpClient : public Client
uint16_t aServerPort,
const char* aURLPath,
const char* aUserAgent =NULL,
const char* aContentType =NULL,
const char* aBody =NULL)
const char* aContentType =NULL,
const char* aBody =NULL)
{ return startRequest(aServerName, aServerPort, aURLPath, HTTP_METHOD_POST, aUserAgent, aContentType, aBody); }

/** Connect to the server and start to send a POST request.
Expand All @@ -149,8 +149,8 @@ class HttpClient : public Client
int post(const char* aServerName,
const char* aURLPath,
const char* aUserAgent =NULL,
const char* aContentType =NULL,
const char* aBody =NULL)
const char* aContentType =NULL,
const char* aBody =NULL)
{ return startRequest(aServerName, kHttpPort, aURLPath, HTTP_METHOD_POST, aUserAgent, aContentType, aBody); }

/** Connect to the server and start to send a POST request. This version connects
Expand All @@ -169,8 +169,8 @@ class HttpClient : public Client
uint16_t aServerPort,
const char* aURLPath,
const char* aUserAgent =NULL,
const char* aContentType =NULL,
const char* aBody =NULL)
const char* aContentType =NULL,
const char* aBody =NULL)
{ return startRequest(aServerAddress, aServerName, aServerPort, aURLPath, HTTP_METHOD_POST, aUserAgent, aContentType, aBody); }

/** Connect to the server and start to send a POST request. This version connects
Expand All @@ -187,8 +187,8 @@ class HttpClient : public Client
const char* aServerName,
const char* aURLPath,
const char* aUserAgent =NULL,
const char* aContentType =NULL,
const char* aBody =NULL)
const char* aContentType =NULL,
const char* aBody =NULL)
{ return startRequest(aServerAddress, aServerName, kHttpPort, aURLPath, HTTP_METHOD_POST, aUserAgent, aContentType, aBody); }

/** Connect to the server and start to send a PUT request.
Expand Down

0 comments on commit 4b44568

Please sign in to comment.