Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
70b5f413
Commit
70b5f413
authored
Feb 23, 2017
by
Sergey Lyubka
Committed by
Cesanta Bot
Feb 23, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add http post example
PUBLISHED_FROM=94f830a5fa4b806fb2cf60c93a9e8744022ff8d7
parent
17cfecc5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
+10
-11
mongoose.c
mongoose.c
+10
-11
No files found.
mongoose.c
View file @
70b5f413
...
...
@@ -4968,10 +4968,10 @@ int mg_normalize_uri_path(const struct mg_str *in, struct mg_str *out) {
#if MG_ENABLE_HTTP
/* Amalgamated: #include "common/md5.h" */
/* Amalgamated: #include "common/sha1.h" */
/* Amalgamated: #include "mongoose/src/internal.h" */
/* Amalgamated: #include "mongoose/src/util.h" */
/* Amalgamated: #include "common/sha1.h" */
/* Amalgamated: #include "common/md5.h" */
static
const
char
*
mg_version_header
=
"Mongoose/"
MG_VERSION
;
...
...
@@ -5825,8 +5825,7 @@ static void mg_http_multipart_begin(struct mg_connection *nc,
mbuf_remove
(
io
,
req_len
);
}
exit_mp:
;
exit_mp:
;
}
#define CONTENT_DISPOSITION "Content-Disposition: "
...
...
@@ -7189,8 +7188,7 @@ MG_INTERNAL int mg_uri_to_local_path(struct http_message *hm,
if
(
*
p
==
'\0'
||
*
p
==
DIRSEP
#ifdef _WIN32
/* On Windows, "/" is also accepted, so check for that too. */
||
*
p
==
'/'
||
*
p
==
'/'
#endif
)
{
ok
=
0
;
...
...
@@ -7732,13 +7730,14 @@ struct mg_connection *mg_connect_http_opt(struct mg_mgr *mgr,
mg_basic_auth_header
(
user
,
pass
,
&
auth
);
}
if
(
post_data
==
NULL
)
post_data
=
""
;
if
(
extra_headers
==
NULL
)
extra_headers
=
""
;
mg_printf
(
nc
,
"%s %s HTTP/1.1
\r\n
Host: %s
\r\n
Content-Length: %"
SIZE_T_FMT
"
\r\n
%.*s%s
\r\n
%s"
,
post_data
==
NULL
?
"GET"
:
"POST"
,
path
,
addr
,
post_data
==
NULL
?
0
:
strlen
(
post_data
),
(
int
)
auth
.
len
,
(
auth
.
buf
==
NULL
?
""
:
auth
.
buf
),
extra_headers
==
NULL
?
""
:
extra_headers
,
post_data
==
NULL
?
""
:
post_data
);
post_data
[
0
]
==
'\0'
?
"GET"
:
"POST"
,
path
,
addr
,
strlen
(
post_data
),
(
int
)
auth
.
len
,
(
auth
.
buf
==
NULL
?
""
:
auth
.
buf
),
extra_headers
,
post_data
);
mbuf_free
(
&
auth
);
MG_FREE
(
user
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment