UPS标签生成具有多行地址的Restful API
我正在尝试生成带有多行地址的标签。...文档说地址线的出现可能出现三遍。但是,这是无效的JSON,我不确定该如何进行。
Address: &ShipmentAddress{
AddressLine: `Street Value \n Suite122`
City: "City",
StateProvinceCode: "State",
PostalCode: "ZIP",
CountryCode: "COUNTRY",
},
上述值不起作用。
I am trying to generate a label with a multiline address.... the docs say the occurrence of AddressLine can appear three times. however this is invalid json and I am not sure how to go about it in GO.
Address: &ShipmentAddress{
AddressLine: `Street Value \n Suite122`
City: "City",
StateProvinceCode: "State",
PostalCode: "ZIP",
CountryCode: "COUNTRY",
},
The above value does not work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
https://go.dev/play/play/p/10sz63fskaf
https://go.dev/play/p/10SZ63FSKAf
当文档说它支持3个发生时,这意味着它可以像示例中的字符串一样,或者最多3个字符串元素。 [“ 123街”,“ 5室”]
将获得一个标签:
123 Street
房间5
When the docs says it supports 3 occurrences they mean that it can be either just a string like in your example or an array up to 3 string elements. ["123 Street", "Room 5"]
Would get a label of:
123 Street
Room 5