Spotify Web API 特殊字符 [英] Spotify Web API special characters
问题描述
Spotify Web API 是否有关于搜索时哪些字符有效的文档?例如,Macklemore & Ryan Lewis"需要 &被 url 编码以便请求工作.
Is there any documentation for the Spotify Web API as to which characters are valid when searching? For example "Macklemore & Ryan Lewis" needs the & to be url encoded in order for the request to work.
字符:"似乎是完全无效的.为了搜索像Pink Friday: Roman Reloaded"这样的专辑,我必须从字符串中完全删除 : .即使是 URL 编码也不起作用.这可能与以下事实有关: : 似乎用于分隔查询的字段.
The character ":" is completely invalid it seems. In order to search for an album like "Pink Friday: Roman Reloaded", I have to remove the : completely from the String. Even URL encoding it doesn't work. This probably was to do with the fact that : seems to be used to separate the fields of the query.
其他字符,如 .[()/似乎工作正常.任何地方的任何文档?只是想知道我们是全面的.谢谢.
Other characters like .[()/ seem to work ok. Any docs on this anywhere? Just want to know we are being comprehensive. Thanks.
推荐答案
以 Björk 为例 这里,
Given the Björk example here,
http://ws.spotify.com/search/1/artist?q=artist:Bj%C3%B6rk
您需要百分比编码.不确定你使用的是什么技术,如果 javascript,这个答案应该有帮助 - URL 编码看到&"(&符号)作为&"HTML 实体.
You'll need percent encoding. Not sure what technology you're using, if javascript, this answer should help - URL encode sees "&" (ampersand) as "&" HTML entity.
更新:
冒号是用于 高级搜索.涉及冒号的查询需要引用,除非是高级搜索:)
Colons are special characters used for advanced search. Queries involving colons need to be quoted, unless it's an advanced search :).
这篇关于Spotify Web API 特殊字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!