1

I'm working on a page with some API instructions. I make efforts to use proper HTML code, whenever possible, but I'm kind of stumped as to what to use for the word GET (as in this is a GET request, not a PUT request) in the instructions. It isn't a big deal, but it does make me feel like I do my job just a bit better.

It's not something that the user types, so <kbd> doesn't really seem relevant. <samp> doesn't seem to fit, either, as it's not something that would be output to the screen. I considered <code>, but that just doesn't sit right.

A lot of the websites that give API instructions don't seem to care much about semantics.

Any recommendations?

4

1 回答 1

5

元素_code

代码元素表示计算机代码的片段。这可以是 XML 元素名称、文件名、计算机程序或计算机可以识别的任何其他字符串。

表示 HTTP 方法的正确元素也是如此<code>(因为这是一个“计算机可以识别的字符串)。您甚至可以添加一个类。

<code class="http"><code class="method">GET</code> <code class="Request-URI URI">/</code> <code class="version">HTTP/1.1</code></code>
于 2013-07-24T15:39:36.080 回答