Results 1 to 7 of 7

Thread: Redmine Rest API

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2016
    Posts
    54
    Thanks
    7
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Redmine Rest API

    Hii everyone

    I'm using Redmine Rest API for my project, I can create, update, delete, ... (Users, Projects, ...) using POST, GET, PUT, DELETE

    I want to get the response from Redmine if create (for example) was OK

    From Redmine documentation :
    Response:

    201 Created: user was created
    422 Unprocessable Entity: user was not created due to validation failures (response body contains the error messages)
    Redmine REST API screenshot : Capture du 2016-05-23 12:23:19.png

    Qt Code :
    Qt Code:
    1. QNetworkReply *reply = manager->post(request, dataByteArray);
    2. /* The finished() signal is triggered once an HTTP request is complete, by connect method we are connecting finished signal with the slot method onRequestFinished(user defined method). If it returns true it means connection is successful else not. You can process the response of the call in this user defined method */
    3. result = connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(onRequestFinished(QNetworkReply*)));
    4.  
    5. // Create user : ok
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. void TestClass::onRequestFinished(QNetworkReply* reply)
    2. {
    3. QString strReply = reply->readAll();
    4. qDebug() << strReply;
    5. }
    To copy to clipboard, switch view to plain text mode 

    strReply : contains the json response : name, email, ...

    So how can I get the response from Redmine : 201 Created or 422 Unprocessable Entity ??

    Thanks
    Last edited by Binary01; 23rd May 2016 at 12:48.

Similar Threads

  1. connect to rest service with qt and error SSL handshake failed
    By panagiotisss in forum Qt Programming
    Replies: 5
    Last Post: 24th September 2015, 09:56
  2. Rest Web Service - Keep-alive Connection
    By buleron in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 29th May 2015, 15:54
  3. Replies: 1
    Last Post: 15th June 2012, 12:45
  4. Replies: 12
    Last Post: 22nd April 2012, 21:48
  5. Removing divider between menubar and rest of main window
    By tgreaves in forum Qt Programming
    Replies: 4
    Last Post: 18th February 2009, 19:34

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.