How can I port sendCustomRequest to qt extended



  • Hi,

    I am working on project, which requires QNetworkAccessmanager. I got sample code from internet which uses sendCustomRequest. But the problem is i am using qt-extended-4.4.3

    But sendCustomRequest is not available in qt-extended. How can I port this function.
    Where can I get source code.
    my example code:

    if (input->http_method == "GET") {
            manager->get(request);
        }
        else if (input->http_method == "POST") {
            manager->post(request, request_content);
        }
        else if (input->http_method == "PUT") {
            manager->put(request, request_content);
        }
        else if (input->http_method == "HEAD") {
            manager->head(request);
        }
        else if (input->http_method == "DELETE") {
            manager->deleteResource(request);
        }
        else {
            QBuffer buff(&request_content);
            manager->sendCustomRequest(request, input->http_method.toLatin1(), &buff);
        }
    

    compilation output:

    user@user-Lenovo-G50-80:~/resttest$ make
    arm-iwmmxt-linux-gnueabi-g++ -c -pipe -gstabs+ -ggdb3 -DQT_KEYPAD_NAVIGATION -mabi=aapcs-linux -I/opt/marvel/sysroot/usr/include -O2 -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/media/109gb/projects/device/data/opt/marvel/sysroot/usr/QtopiaSDK/qtopiacore/target/mkspecs/default -I. -I/media/109gb/projects/device/data/opt/marvel/sysroot/usr/QtopiaSDK/qtopiacore/target/include/QtCore -I/media/109gb/projects/device/data/opt/marvel/sysroot/usr/QtopiaSDK/qtopiacore/target/include/QtSql -I/media/109gb/projects/device/data/opt/marvel/sysroot/usr/QtopiaSDK/qtopiacore/target/include/QtNetwork -I/media/109gb/projects/device/data/opt/marvel/sysroot/usr/QtopiaSDK/qtopiacore/target/include/QtGui -I/media/109gb/projects/device/data/opt/marvel/sysroot/usr/QtopiaSDK/qtopiacore/target/include -I. -I. -o test.o test.cpp
    test.cpp: In member function 'void test::execute(HttpRequestInput*)':
    test.cpp:267: error: 'class QNetworkAccessManager' has no member named 'sendCustomRequest'
    
    

    I have checked qnetworkaccessmanager.h, there is no function. How can i port that function.

    please help ASAP!


  • Lifetime Qt Champion

    Hi,

    There's only one way to port it: check the implementation of that function in version of Qt that supports it and then try to write the same one for your version of Qt. Beware: Qt 4.4.3 is pretty old.



  • @SGaist said:

    There's only one way to port it: check the implementation of that function in version of Qt that supports it and then try to write the same one for your version of Qt. Beware: Qt 4.4.3 is pretty old.

    HI,

    yeah I know it is pretty old. But it is last version of qt-extended. There is no further development for it. I tried to get source code. But I didn't, so can you give the link or post the function definition



  • @SGaist

    HI,

    yeah I know it is pretty old. But it is last version of qt-extended. There is no further development for it. I tried to get source code. But I didn't, so can you give the link or post the function definition


  • Lifetime Qt Champion

    Just take a look at the latest Qt 4 sources available, it's there. The function was introduced in Qt 4.7.



  • @SGaist said:

    Thanks for suggestion.
    Can you provide link to download source.


  • Lifetime Qt Champion

    The easiest is to clone the repository

    git clone git://code.qt.io/qt/qt.git
    

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.