Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Host ends with / and extra URL starts with /
Message
From
29/11/2016 04:47:21
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 5.0
OS:
Windows 10
Database:
MS SQL Server
Miscellaneous
Thread ID:
01644033
Message ID:
01644070
Views:
40
This message has been marked as the solution to the initial question of the thread.
Likes (1)
>Hi everybody,
>
>I have tcHost variable in the form of https://mySite.com/
>
>and I have API url such as
>
>"/integrationapi//Attraction/Tickets/Use"
>
>I have the following code
>
>
>request = WebRequest.Create(tcHost + url) as HttpWebRequest;
>
>I'm wondering does it matter that with that concatenation I'm getting // before integration. If it matters, is there anything in .NET that will properly concatenate these two things?
>
>Thanks in advance.

Safest way:
char[] c = { Path.AltDirectorySeparatorChar };
string fullPath = tcHost.TrimEnd(c) +url;
Previous
Reply
Map
View

Click here to load this message in the networking platform