Example #1
0
static PyObject*
http_head(PyObject* self, PyObject* args)
{
    const char* host, *port;
    if (!PyArg_ParseTuple(args, "ss", &host, &port))
    {
        return NULL;
    }
    long ret = c_http_head(host, port);
    return PyInt_FromLong(ret);
}
Example #2
0
static PyObject*
http_head(PyObject* self, PyObject* args)
{
    const char* host, *port;
    if (!PyArg_ParseTuple(args, "ss", &host, &port))
    {
        return NULL;
    }
    long ret = c_http_head(host, port);
#if PY_MAJOR_VERSION >= 3
    return PyLong_FromLong(ret);
#else
    return PyInt_FromLong(ret);
#endif
}