websurltype.htm
来自「goahead是linux下的轻量级web服务器」· HTM 代码 · 共 80 行
HTM
80 行
<html>
<head>
<title>websUrlType -- GoAhead WebServer API</title>
<link rel="stylesheet" href="../../style/doc.htm" type="text/css">
</head>
<body>
<TABLE border=0 width=100% cellspacing=0 cellpadding=0>
<TR>
<TD class=title-left><b>websUrlType</b></TD>
<TD class=title-center><b> GoAhead WebServer API</b></TD>
<TD class=title-right><B> GoAhead EMF</B></TD>
</TR>
</TABLE>
<HR>
<h2>Synopsis</h2>
<p>Parse a URL into its component parts</p>
<h2>Prototype</h2>
<pre>
#include "webs.h"
char_t *<b>websUrlType</b>(char_t *url, char_t *buf, int bufsize);
</pre>
<h2>Parameters</h2>
<p><table width=90%>
<TR>
<TD width=40>url
<TD>Source URL to parse
<TR>
<TD width=40>buf
<TD> User supplied buffer to hold the mime type
<TR>
<TD width=40>bufsize
<TD>Size of buf</TD> </TR></table></p>
<h2>Description</h2>
<P>The websUrlType procedure returns the mime type for a
given URL by examining the URL document name extension. If the mime type is
unknown, "text/plain" will
be returned.</P>
<P>
</P>
<P>If you are using the GoAhead WebServer, the mime types
are defined in mime.c. If you are using the GoAhead EMF, they are automatically
defined
for you.</P>
<P>
</P>
<h2>Return Value</h2>
<p> Returns a pointer to the user supplied buffer in
<EM>buf</EM>
.</p>
<h2>Example</h2>
<pre>
char_t mimeType[80];
websUrlType(url, mimeType, sizeof(mimeType));
if (strcmp(mimeType, "text/plain") == 0) {
}
</pre>
<h2>See Also</h2>
<p>
<A href="websUrlParse.htm">websUrlParse</A>
</p>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?