ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# AddUrlSegment `AddUrlSegment(Key, Value)` `Key-{String}` `Value-{Variant}` Url Segments用于轻松向Resource添加动态值。 使用大括号在Resource中创建Url Segment,然后使用AddUrlSegment替换为动态值。 ``` Dim Request As New WebRequest Dim User As String Dim Id As Long User = "Tim" Id = 123 '// OK: Use string concatenation for dynamic values Request.Resource = User & "/messages/" & Id '// BETTER: Use Url Segments for dynamic values Request.Resource = "{User}/messages/{Id}" Request.AddUrlSegment "User", User Request.AddUrlSegment "Id", Id Request.FormattedResource '// = "Tim/messages/123" ```