💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
# 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" ```