Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
uHttpSharp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Scott Duncan
uHttpSharp
Commits
ff43b5c9
Commit
ff43b5c9
authored
Jan 21, 2014
by
Shani Elharrar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More DebuggerDisplays
parent
580e6265
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
uhttpsharp/Headers/HttpHeadersExtensions.cs
uhttpsharp/Headers/HttpHeadersExtensions.cs
+13
-0
uhttpsharp/HttpRequest.cs
uhttpsharp/HttpRequest.cs
+16
-0
No files found.
uhttpsharp/Headers/HttpHeadersExtensions.cs
View file @
ff43b5c9
using
System
;
using
System.Text
;
namespace
uhttpsharp.Headers
{
...
...
@@ -30,5 +31,17 @@ namespace uhttpsharp.Headers
headers
.
TryGetByName
(
name
,
out
value
);
return
value
;
}
public
static
string
ToUriData
(
this
IHttpHeaders
headers
)
{
var
builder
=
new
StringBuilder
();
foreach
(
var
header
in
headers
)
{
builder
.
AppendFormat
(
"{0}={1}&"
,
Uri
.
EscapeDataString
(
header
.
Key
),
Uri
.
EscapeDataString
(
header
.
Value
));
}
return
builder
.
ToString
(
0
,
builder
.
Length
-
1
);
}
}
}
\ No newline at end of file
uhttpsharp/HttpRequest.cs
View file @
ff43b5c9
...
...
@@ -19,12 +19,14 @@
using
System
;
using
System.CodeDom
;
using
System.Collections.Generic
;
using
System.Diagnostics
;
using
System.IO
;
using
System.Threading.Tasks
;
using
uhttpsharp.Headers
;
namespace
uhttpsharp
{
[
DebuggerDisplay
(
"{Method} {OriginalUri,nq}"
)]
internal
class
HttpRequest
:
IHttpRequest
{
private
readonly
IHttpHeaders
_headers
;
...
...
@@ -80,6 +82,20 @@ namespace uhttpsharp
{
get
{
return
_queryString
;
}
}
internal
string
OriginalUri
{
get
{
if
(
QueryString
==
null
)
{
return
Uri
.
OriginalString
;
}
return
Uri
.
OriginalString
+
"?"
+
QueryString
.
ToUriData
();
}
}
}
public
interface
IHttpRequest
...
...
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