Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
coeurl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nheko Reborn
coeurl
Commits
047199b7
Verified
Commit
047199b7
authored
3 years ago
by
Thulinma
Committed by
Nicolas Werner
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Implement delete request with request body
parent
22f58922
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/coeurl/client.hpp
+2
-0
2 additions, 0 deletions
include/coeurl/client.hpp
lib/client.cpp
+18
-0
18 additions, 0 deletions
lib/client.cpp
with
20 additions
and
0 deletions
include/coeurl/client.hpp
+
2
−
0
View file @
047199b7
...
...
@@ -44,6 +44,8 @@ struct Client {
long
max_redirects
=
0
);
void
delete_
(
std
::
string
url
,
std
::
function
<
void
(
const
Request
&
)
>
callback
,
const
Headers
&
headers
=
{},
long
max_redirects
=
0
);
void
delete_
(
std
::
string
url
,
std
::
string
request_body
,
std
::
string
mimetype
,
std
::
function
<
void
(
const
Request
&
)
>
callback
,
const
Headers
&
headers
=
{},
long
max_redirects
=
0
);
void
head
(
std
::
string
url
,
std
::
function
<
void
(
const
Request
&
)
>
callback
,
const
Headers
&
headers
=
{},
long
max_redirects
=
0
);
void
options
(
std
::
string
url
,
std
::
function
<
void
(
const
Request
&
)
>
callback
,
const
Headers
&
headers
=
{},
...
...
This diff is collapsed.
Click to expand it.
lib/client.cpp
+
18
−
0
View file @
047199b7
...
...
@@ -368,6 +368,24 @@ void Client::delete_(std::string url, std::function<void(const Request &)> callb
this
->
submit_request
(
std
::
move
(
req
));
}
void
Client
::
delete_
(
std
::
string
url
,
std
::
string
request_body
,
std
::
string
mimetype
,
std
::
function
<
void
(
const
Request
&
)
>
callback
,
const
Headers
&
headers
,
long
max_redirects
)
{
auto
req
=
std
::
make_shared
<
Request
>
(
this
,
Request
::
Method
::
Delete
,
std
::
move
(
url
));
req
->
request
(
request_body
,
mimetype
);
req
->
on_complete
(
std
::
move
(
callback
));
if
(
!
headers
.
empty
())
req
->
request_headers
(
headers
);
if
(
max_redirects
>
0
)
req
->
max_redirects
(
max_redirects
);
req
->
connection_timeout
(
connection_timeout_
);
this
->
submit_request
(
std
::
move
(
req
));
}
void
Client
::
head
(
std
::
string
url
,
std
::
function
<
void
(
const
Request
&
)
>
callback
,
const
Headers
&
headers
,
long
max_redirects
)
{
auto
req
=
std
::
make_shared
<
Request
>
(
this
,
Request
::
Method
::
Head
,
std
::
move
(
url
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment