File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed
Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 11[package ]
22name = " uapi-sdk-rust"
3- version = " 0.1.2 "
3+ version = " 0.1.3 "
44edition = " 2021"
55license = " MIT OR Apache-2.0"
66description = " UAPI Rust SDK - idiomatic, typed, domain-driven API client."
77repository = " https://github.com/AxT-Team/uapi-sdk-rust"
8+ documentation = " https://docs.rs/uapi-sdk-rust"
89readme = " README.md"
910keywords = [" uapi" , " sdk" , " api" , " client" ]
1011categories = [" api-bindings" , " web-programming::http-client" ]
Original file line number Diff line number Diff line change 44
55[ ![ Rust] ( https://img.shields.io/badge/Rust-1.75+-DEA584?style=flat-square&logo=rust&logoColor=white )] ( https://www.rust-lang.org/ )
66[ ![ Docs] ( https://img.shields.io/badge/Docs-uapis.cn-2EAE5D?style=flat-square )] ( https://uapis.cn/ )
7+ [ ![ docs.rs] ( https://img.shields.io/docsrs/uapi-sdk-rust?label=docs.rs&style=flat-square )] ( https://docs.rs/uapi-sdk-rust )
78
89> [ !NOTE]
910> 所有接口的 Rust 示例都可以在 [ UApi] ( https://uapis.cn/docs/introduction ) 的接口文档页面,向下滚动至 ** 快速启动** 区块后直接复制。
Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ use std::time::Duration;
1212use tracing:: { debug, instrument} ;
1313use url:: Url ;
1414
15- static DEFAULT_BASE : & str = "https://uapis.cn/api/v1" ;
16- static DEFAULT_UA : & str = "uapi-sdk-rust/0.1.2 " ;
15+ static DEFAULT_BASE : & str = "https://uapis.cn/api/v1/ " ;
16+ static DEFAULT_UA : & str = "uapi-sdk-rust/0.1.3 " ;
1717static DEFAULT_BASE_URL : Lazy < Url > =
1818 Lazy :: new ( || Url :: parse ( DEFAULT_BASE ) . expect ( "valid default base" ) ) ;
1919
@@ -111,7 +111,8 @@ impl Client {
111111 query : Option < Vec < ( String , String ) > > ,
112112 json_body : Option < serde_json:: Value > ,
113113 ) -> Result < T > {
114- let url = self . base_url . join ( path) ?;
114+ let clean_path = path. trim_start_matches ( '/' ) ;
115+ let url = self . base_url . join ( clean_path) ?;
115116 let mut req = self . http . request ( method. clone ( ) , url. clone ( ) ) ;
116117
117118 let mut merged = HeaderMap :: new ( ) ;
You can’t perform that action at this time.
0 commit comments