Spotify Web API特殊字符 [英] Spotify Web API special characters

查看:87
本文介绍了Spotify Web API特殊字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于搜索时哪些字符有效,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.

似乎字符:"完全无效.为了搜索像粉红星期五:罗马重装"这样的专辑,我必须从字符串中完全删除:.甚至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示例这里

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆