MDS Http POST packet size restriction?

Hello

I have a problem with my application and a device connected to a BES for applications (MDS_4.1.7.16)

I have this code example:

      connection = (HttpConnection) Connector.open(this.url,Connector.READ_WRITE,true);

      connection.setRequestMethod(HttpConnection.POST);

      connection.setRequestProperty("User-Agent", "MyUseragent";

      connection.setRequestProperty("Content-Type", "multipart/form-data" + "; boundary=" +  boundary);      

      connection.setRequestProperty("Content-Length","" + data.length);       connection.setRequestProperty("Connection","close");

      if (data != null && data.length > 0) {

        output = new DataOutputStream(connection.openDataOutputStream());        System.out.println("output opened");        output.write(data,0,data.length);        System.out.println("output wrote");           //output.flush();         //output.close();  input = new DataInputStream(connection.openInputStream());        System.out.println("input opened"); .... ....      }

And then I close all my connections in a finally block

To resume I've got this output:

exit open
output wrote

When I try to write a few bytes on my outputstream there is no problem (got the entry 'opens'), but when I try to write about 29kilobytes, everythings seems good, but after the output.write (), the connection seems damaged... My input stream cannot be opened lock on it without any errors. I try with a flush() function and a close() after writing and then it is hunting water or closing that block my thread without exception more.

Y at - it no limitation with the BES/MDS of MESSAGE size? I do my testing on a Blackberry Curve 8900 with OS 4.6.1.310

Can I see any error on my bes log error? Could not find any information in the log folder...

I have this problem only when I push my application via BES and not when I deploy it with JavaLoader. There is the default policy for the user and the cause of the application this is a new installation.

Thank you in advance, I really need your help!

Good bye

Hello

I found a solution that allow me to download my packages of 25 KB.

I added a line in the header of the border: "Content-Transfer-Encoding: binary\r\n";

After:

' Content-Disposition: form-data; name =-"o"; ("filename =------'b\' \r\n ');
"" Content-Type: application/octet-stream\r\n ");"

But now I have another problem.

When my BES is offline my packages come up on a public MDS who?

And when it is in offline mode I have the same problem of packet size, the ' Content-Transfer-Encoding: binary "seems to be not taken into consideration by the public MDS?

How can I do, there are other properties that I can put?

Thanks in advance,

bloobi

Tags: BlackBerry Developers

Similar Questions

  • UDP EDNS packet size

    Hey everybody

    I have a BIND server 9.8.1 - P1 on the local network behind a firewall UTM5 running firmware 1.3.15 - 28.

    My DNS lookups are horribly slow to BIND. Ask the journal I found that server complains that, "after having reduced the size of package UDP EDNS announced at 512 bytes", it can make a successful determination.

    Now, that tells me that the UTM5 cannot accept UDP greater than 512 EDNS packets.

    ISS this correct?

    I also see a lot of these errors:
    error (no valid RRSIG) resolve "prosecure.com/DS/IN": 4.2.2.2 #53

    The maximum size of the DNS default UDP packets is 512. Most of the routers on the Internet will be blocking the packets UDP exceeds this size.

    http://StackOverflow.com/questions/1098897/what-is-the-largest-safe-UDP-packet-size-on-the-Internet

  • Http post: post body contains less bytes specified by the length of the content

    Hello

    in my application, I do a http post using this code (fieldsToSend and referentiToSend are both initialized before vector)

    HttpConnection conn = null;
    InputStream is = null;
    OutputStream os = null;

    Conn = (HttpConnection), Connector.open (Constants.Synch.URL_NOTIFY);
                
    conn.setRequestMethod (HttpConnection.POST);
                
    URLEncodedPostData post = new URLEncodedPostData ("UTF - 8", false);

    for (int i = 0; i)< fieldstosend.size();="" ++i)="">
    String name = "visited" + (i + 1);
    String value = (String) fieldsToSend.elementAt (i);
    post. Append (name, value);
    }
                
    for (int i = 0; i)< referentitosend.size();="" ++i)="">
    String name = "contact" + (i + 1);
    String value = (String) referentiToSend.elementAt (i);
    post. Append (name, value);
    }

    conn.setRequestProperty ("Content-Type", post.getContentType ());
    conn.setRequestProperty ("Content-Length", (New Integer (post.getBytes () .length)) m:System.NET.SocketAddress.ToString ());
                
    OS = conn.openOutputStream ();
    OS. Write (post. GetBytes());
    OS. Flush();
                
    Int State = conn.getResponseCode ();

    If (status == HttpConnection.HTTP_OK) {}

    do something

    }

    If I'm reading the server log I see this error

    SRTServletReq E SRVE0133E: an error occurred during parsing of the parameters. java.io.IOException: SRVE0216E: body of the message contains less bytes specified by the length of the content

    Can you tell me where is the problem?

    Thanks in advance.

    Kind regards

    Gianni.

    Apologies... The problem was on the servlet, not on the BlackBerry. I'm sorry too...

  • OutofMemoryException/EOFException when bleow data via HTTP POST

    Hello

    I got OutofMemoryException when I download data with size larger than 2 MB. I use http post by specifying

    'Content-Type', ' multipart/form-data; Boundary = boundaryvalue.

    in the header of the request.

    The stacktrace of the exception of 9000 "BOLD" is as below.

    No detail message

    net_rim_cldc (4AAABCA5)

    DataBuffer

    ensureBuffer

    0 x 3690

    net_rim_cldc (4AAABCA5)

    DataBuffer

    To write

    0x3C52

    net_rim_crypto_1-3 (4AAAC974)

    TLSOutputStream

    To write

    0x45C7

    net_rim_cldc-1 (4AAABCA5)

    DataOutputStream

    To write

    0x221D

    net_rim_os-2 (4AAAC894)

    ClientProtocol

    0x1A1D

    net_rim_os-2 (4AAAC894)

    ClientProtocol

    writeRequest

    0 x 1422

    net_rim_os-3 (4AAAC894)

    HttpProtocolBase

    transitionToState

    0x33D7

    net_rim_os-2 (4AAAC894)

    ClientProtocol

    transitionToState

    0x23D4

    net_rim_os-3 (4AAAC894)

    HttpOutputStream

    Rinse

    0x334C

    ....

    When I test Simulator 8300, I got EOFException.

    No detail message
    net_rim_os-2
    ClientProtocol
     
    0 x 1917
    net_rim_os-2
    ClientProtocol
    readResponse
    0x148A
    net_rim_os-3
    HttpProtocolBase
    transitionToState
    0 x 1613
    net_rim_os-2
    ClientProtocol
    transitionToState
    0 x 2335
    net_rim_os-3
    HttpOutputStream
    Rinse
    0x157E

    ...

    This code seems to work for the file with a size less than 2 MB.

    Any suggestions would be very appeciated.

    Thank you

    Itthipon

    I was able to replicate that when you use an OutputStream.  OutputStream to DataOutputStream switching enabled me to show 3 MB of data.  Please give that a try and making me know if you encounter other problems.

  • Failure of HTTP post when connecting via SIP

    Hi all

    I'm doing HTTP post, but I get corrupted in the response data.

    This problem only occurs on the device (4.5) and only if you use the SIP configuration

    (the problem does not when you use a device via Wifi 4.6)

    Here is my code:

    HttpConnection connection = (HttpConnection)Connector.open(url + ";deviceside=false");connection.setRequestProperty("x-rim-transcode-content", "*/*");connection.setRequestMethod(HttpConnection.POST);connection.setRequestProperty("Content-Type","multipart/form-data; boundary=@---------------------------123");connection.setRequestProperty(HttpProtocolConstants.HEADER_CONTENT_LENGTH, String.valueOf(data.length));      OutputStream os = connection.openOutputStream();os.write(data);
    
    if (connection.getResponseCode()==HttpConnection.HTTP_OK){   StringBuffer result = new StringBuffer();   byte[] buffer = new byte[2000];   int i = 0;         DataInputStream in = connection.openDataInputStream();
    
       while ((i = in.read(buffer)) != -1){      result.append(new String(buffer, 0, i,"ISO-8859-1"));   }}
    

    Does someone know what I'm doing wrong here?

    (BTW, the system cut the suffix HTTP "ConnectionType =" which should be equal to "mds" + "»' + 'public')

    I guess that your assumption that the "transcode-including" in the request header method caused the problem was correct.

    I changed the method request header, it shows the HttpConnection API:

    ...
    
    // Set the request method and headers
    c.setRequestMethod(HttpConnection.POST);
    c.setRequestProperty("If-Modified-Since","29 Oct 1999 19:43:31 GMT");
    c.setRequestProperty("User-Agent","Profile/MIDP-2.0 Configuration/CLDC-1.0");
    c.setRequestProperty("Content-Language", "en-US");
    
    ...
    

    and the problem has been corrected

  • HTTPS post doesn't work on device but in the Simulator

    You are looking for suggestions on why a https post works all the time on a simulator, but what installation on the device and test it works the first time but the time the rest of the time after that.

    Here is most of the code, this came from another sample written and posted on BB forums.

    I tried with the removed ConnectionTimeout, and with it the value of different values.

    As mentioned it works the first two times, maybe even just the first time and not after once using the real device.

    Any thoughts would be greatly appreciated.

    private String of doTransaction (postString String)]
    {
    String [] ccResponse;
    HttpsConnection SC;
    OutputStream outStream = null;
    String url = "https://url/; ConnectionTimeout = 60000 "; just removed the url to view the code

    Try
    {
    HC = (HttpsConnection)
    Connector.Open (url, Connector.READ_WRITE); Set the POST request method
    hc.setRequestMethod (HttpsConnection.POST);
    hc.setRequestProperty ("Content-Type", "application/x-www-formulaires-urlencoded");
    hc.setRequestProperty ("Content-Length", Integer.toString (postString.length ()));

    outStream = hc.openDataOutputStream ();
    outStream.write (postString.getBytes ());
    outStream.flush ();
    outStream.close ();
    Get the answer back to the servlet
                
    hc.getResponseCode ();
                
                
    InputStream is = hc.openDataInputStream ();
    LineReader lr = new LineReader (is);

    While (true)

    {
    Try
    {
    Byte [] arr = lr.readLine ();
    String $thisline = new String (arr);
    Dialog.Inform ($thisline);
    If (! thisLine.endsWith ("="))
    {
    Dialog.Inform ("splitting");
    If ends with =, not split
    String [] splitLineResponse;
    String separator = '=';
    splitLineResponse = split (new String (arr), separator);

    String responseItem = splitLineResponse [0];
    String responseValue = splitLineResponse [1];

    There are a lot of topics split here.

    }
                        
                            
    }
    catch (e EOFException)
    {
    Reached end of file
    Dialog.Inform ("expressions of folklore Exception" + e.getMessage ());
    break;
    }
    }
    HC. Close();
                
    }
    catch (Exception ex)
    {
    Transaction time-out
    Dialog.Alert ("TransException" + ex.getMessage ());

    }
    postData = null;
    Return ccResponse;
            
    }

    How is it a failure?

    My guess is that the problem is that the unit does not have a connection. Without any connection parameter, it will connect via MDS if the device is a network of MDS; If not, he'll probably try direct TCP. In the latter case, it will fail unless the APN settings are set correctly. The carrier may also have something to say about it.

    I suggest you read the post-it by Peter Strange and also check out the videos of transport network that RIM posted. They provide a lot of information on how to establish connections.

  • Authentication http post VI errors

    I am trying to query a web service to third parties non-LabVIEW LabVIEW 2014, using HTTP POST. Using another utility (restclient-ui-3.5-jar-with-dependencies.jar), I checked that URL, user name, password, and query syntax are accurate and are running on the same computer where my VI fails. I must be missing something when translating that to LV, because I get the error 401 (full authentication is required) and also 415 (unsupported media type).

    I have attached the configuration file used for the other utility, my VI and an overview of the response from the Web service for the post of the VI.  I had to make all anonymous, hide url, user, etc., so it can not really be tested as it is, unfortunately. I tried with & without additional authentication header, with & without Config SSL, etc. You can see the different options on the VI.

    Any suggestions?

    Thank you very much.

    Solved my problem with a combination of different required headers and syntax fixes.

  • Getting 7 error with the HTTP POST vi method when deplyed ISO crio as executable... urgent!

    Hi all

    I have an application where I can access the net server point of LabVIEW via the HTTP protocol to send the data. My application works fine when I run it on XP, and also sometimes on cRIO. I'm writing and reading files to store and read data from the server.

    When I do my application executable and deployed on cRIO I am constantly 7 error that says "Error in the node library function to call at the POST vi LabVIEWHTTPCLIENT".

    After getting this error if I try to run the my new project the crio (not through exe) I keep getting the same error. This means once the executable file is deployed on the crio, I get the error in my project application which was working fine before you deploy the executable file.

    7 occurs very frequently. and I am unable to find the reason. I gave all the paths in the constant form located on crio and files accessible also when the application is run.

    Is someone can you please help me what this error 7?

    as a result, that it is bound to the HTTP POST vi method...

    How can it be fix?

    Its quite urgent...

    Thanks in advance.

    Solution is provided by the NOR... Vi POST method missing two files that need to be there in the startup of the CRIO.insted folder there is in the system folder. That's why when running the exe that the startup on crio application it gives error as the files are not there. The fix for this HTTP POST vi update isn't out yet EITHER.

  • HTTP Post documentation does not mention the forums (BUG)

    Documents of the VI of HTTP post (see here) do not mention that there are 2 instances of this VI. It contains only the help on the string instance.

    Right-click on the VI shows that it is a polymorphic VI, with a buffer (string) and the instance of the file (paths).

    Aid for these screws would normally have a ring "Instance" where you could see that there are other forums. (example)

    This absence made me several hours of debugging, because the buffer method stops playback of the chain after finding a NULL byte. (this could be a separate bug).

    In my opinion all polymorphic screws should show their terminal selector.

    Tone

    Your dear,

    I reported the problem of documentation in corrective action request # 244384. I'll have another look in the question on the search for the null byte. Thank you for bringing this place.

    Best regards

  • Problem when using SOAP requests with HTTP POST function

    Hello!

    Using the vi of HTTP POST to send SOAP requests to a device, I encountered a problem.

    Take care of the HTTP header for you HTTP POST vi and defines the type of 'content' as "Content-Type: application/x-www-formulaires-urlencoded. Who is considered to be 'non-soap' requests by some Web servers.

    Standards W3C says in this case, you should be content-type: "application/soap + xml".

    Link to the page to W3C standard: http://www.w3.org/TR/soap12-part0/#L26866

    That is possible to update this feature in a future release so that programmers can choose (or type) the necessary content type?

    Have you tried "Add header" to change?

    http://zone.NI.com/reference/en-XX/help/371361L-01/lvcomm/http_client_addheader/

  • A form of Google with http POST VI

    Dear LabVIEW forum,

    I'm filling out a very simple form of Google consisting of 4 text fields named AI0 AI1, AI2 AI3.

    I use the http POST provided by LabVIEW VI:

    When I run this, a new row is added to the answer sheet, but values do not appear, with the exception of the timestamp.

    What I am doing wrong?

    Thank you!

    Hello

    I had a quick look at the form and text next to the entry boxes is AI0... but the names of the input text boxes aren't AI0 etc.. You may need to get the page first and then scan the page for the name of the entry.

    Mike

  • album art with size restrictions?

    Hello. Being new to the "rocket" I wonder if there is a size restriction concerning the album art files?

    I copied many of my audio files directly to the "rocket". View the album art included as folder.jpg in the respective album folder. That has worked well.

    Now, I have a few more added albums today (.) The OGG files) with the files of art with sizes of some 200 kb which do not show...

    any advice? Thank you

    There is a limit to the size of album art and photos.  It has not documented how this size, so I don't think that someone has found the exact limit.  It is also not clear if this is a file size limit of resolution (or both).

    200 KB sounds like extremely large album art.  I found that the "rocket" is a mediocre (and slow) work resizing photos/art.  You will get a much better quality and more vivid in the UI performance if you resize the album art on the drive to 120 x 120 (the size of the art is displayed full-screen coverage).  In addition, you can save space on the drive as well.

  • http post does not

    I'm setting up a http post in my Blackberry app. I have successfully implemented this in my Android app, so I know the server function find. I tried several different things, and I don't really get errors, it's just that the info on the server is not updated. I looked at this post: Http POST in BlackBerryand many others. I found them useful, but they ultimately do not solve my problem. Yet once, I get errors, but the server is not updated. Here is the code that I currently use:

            String url =http://xxxx.com/ratings/add?;deviceside=tru;
            String postStr1 =business_id=79;
            String postStr2 =rating=;
    
            HttpConnection httpConnection = (HttpConnection) Connector.open(url);
            httpConnection.setRequestMethod(HttpConnection.POST);
            httpConnection.setRequestPropertyContent-Typ,application/x-www-form-urlencode);
    
            URLEncodedPostData encPostData = new URLEncodedPostDataUTF-, false);
            encPostData.appendbusiness_i, String.valueOf(790));
            encPostData.appendratin, String.valueOf(4));
            byte[] postData = encPostData.toString().getBytesUTF-);
    
            httpConnection.setRequestPropertyContent-Lengt, String.valueOf(postData.length));
    
            OutputStream os = httpConnection.openOutputStream();
            os.write(postData);
            os.flush()
    

    All ideas

    He solved. Had to remove deviceside = true

  • HTTP POST: Returns a response of login instead of a JSON response page

    Dear all,

    I just glued a snippet of code for HTTP Post where I WRITE a message to multiple parties to the server that will
    Authentication. I expect a response the following JSON. But when I run the present I always LOGIN
    Page in HTML.

    Can someone let me know the problem in the code below...

    Thanks a ton for your help.

    Thank you
    MGR

    / public final class MyScreen extends form {}
    private RichTextField _Output;
    public MyScreen() {}
    Set the displayed title of the screen
    setTitle ("MyTitle");

    _Output = new RichTextField();
    Add (_output);
    addMenuItem (_GetDataAction);
    }
    protected _GetDataAction MenuItem = new MenuItem ("GetData", 100000, 10) {}
    public void run() {}
    String URL = "";
    ServiceRequestThread svc = new ServiceRequestThread (URL,
    (MyScreen) UiApplication.getUiApplication)
    (. getActiveScreen());
    SVC. Start();
    }
    };
    {} public void updateDestination (final String text)
    UiApplication.getUiApplication () .invokeLater (new Runnable() {}
    public void run() {}
    _Output.SetText (Text);
    }
    });
    }

    }
    class ServiceRequestThread extends Thread {}

    protected String _URL;
    protected MyScreen _Dest = null;
    protected URLEncodedPostData _PostData = null;
    StringBuffer writer = new StringBuffer();

    {} public void setPOSTData (URLEncodedPostData data)
    _PostData = data;
    }

    public ServiceRequestThread (String URL, display MyScreen) {}
    Super();
    Dest = screen;
    _URL = URL;
    }

    public void run() {}
      
    Try
    {
    String limit = "SATBA";
    String twoHyphens = "-";
    "{String data1 = '{\"IMPORTING\': {\"IN_COUNTRY_CODE\":\"US\'}} ';
    String CRLF = "\r\n";
    Byte [] encrypted = Base64OutputStream.encode ("Userassword".getBytes (), 0, "userassword".length (), false, false);
           
    "Preparing the post data.
         
    Writer.Append ("-" + boundary) .append (CRLF);
    Writer.Append ("Content-Disposition: form-data;") Name = ()-"param\" ")." Append
    CRLF);
    Writer.Append ("Content-Type: text/json;") charset ="+" UTF - 8 ") .append (CRLF);
    Writer.Append ("Content-Transfer-Encoding: 8 bit") .append (CRLF);
    Writer.Append ("request - ID:Abcd123456"). Append (CRLF);
    Writer.Append("request-type:rfc_json"). Append (CRLF);
    Writer.Append ("Function:00163E0136C01EE0AE8B059433A71727")
    . Append (CRLF);
    Writer.Append (CRLF);
    Writer.Append (data1). Append (CRLF);
    Writer.Append("--" + Boundary + "--"). Append (CRLF);
    String string = new String (writer);
                           
    HttpConnection conn1 = (HttpConnection) Connector.open (_URL, Connector.READ_WRITE);
    conn1.setRequestMethod (HttpConnection.post);
    conn1.setRequestProperty ("authorization", "Basic" + new String (encoded));
    conn1.setRequestProperty ("Content-Type", "multipart/mixed; limit =" + limit);
     
    OutputStreamWriter osw is new OutputStreamWriter (conn1.openOutputStream (), 'UTF-8');.
    OSW. Write (String);
    OSW. Flush();
    OSW. Close();
       
    int responseCode = conn1.getResponseCode ();
    If (responseCode == HttpConnection.HTTP_OK) {}
    Given InputStream = conn1.openInputStream ();
    Gross StringBuffer = new StringBuffer();
    Byte [] buf = new byte [4096];
    not read int = data.read (buf);
    While (not read > 0) {}
    RAW. Append (new String (buf, 0, read));
    not read = data.read (buf);
    }
    _Dest.updateDestination (RAW. ToString());
    } else {}
    _Dest.updateDestination ("responseCode ="
    + Integer.toString (responseCode));
    }
    }
    catch (IOException e)
    {
    e.printStackTrace ();
    _Dest.updateDestination("exception:"+e.ToString());)
    }
    }

    }

    Hello

    Thank you very much code was perfectly fine and she is on property rim.public of the file where the

    application.handler.http.AuthenticationSupport has been set to true, and because of this in the fact that he wasn't loggging.

    Now I put it to false, and the correct answer came.

    Thank you very much.

    Best regards

    MGR

  • Sending parameter using the METHOD (HTTP POST = PROBLEM WEBSERVICE)

    Hello world

    I need help here

    I tried 1 week to the code to send the parameter but the error still result

    It sends no parameter at all the

    Heres my PPC

    ApplicationUI::ApplicationUI(bb::cascades::Application *app) :
            QObject(app)
    {
    
        m_pTranslator = new QTranslator(this);
        m_pLocaleHandler = new LocaleHandler(this);
    
        bool res = QObject::connect(m_pLocaleHandler, SIGNAL(systemLanguageChanged()), this, SLOT(onSystemLanguageChanged()));
        // This is only available in Debug builds
        Q_ASSERT(res);
        // Since the variable is not used in the app, this is added to avoid a
    
        Q_UNUSED(res);
    
        onSystemLanguageChanged();
    
        QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
    
        qml->setContextProperty("MyApp",this);
        // Create root object for the UI
        AbstractPane *root = qml->createRootObject();
    
        // Set created root object as the application scene
        app->setScene(root);
    }
    
    void ApplicationUI::post(const QString &fullName, const QString &email, const QString &password)
    {
        QNetworkAccessManager connection;
    
        QUrl url("http://www.rws.rajaspot.com/rs_usermanagementclient.php");
        QNetworkRequest req(url);
        //url.addQueryItem("parameter", "14");
    
        QByteArray postData;
    
        postData.append("method=rsnewuser&").append("fullName="+fullName).append("email="+email).append("password="+password);
    
        QNetworkReply* reply = connection.post(req, postData);
        bool ok = connect(reply, SIGNAL(finished()), this, SLOT(postFinished()));
        Q_ASSERT(ok);
        Q_UNUSED(ok);
    
    }
    
    /**
     * PostHttp::onGetReply()
     *
     * SLOT
     * Read and return the http response from our http post request
     */
    void ApplicationUI::postFinished()
    {
        QNetworkReply* reply = qobject_cast(sender());
    
        /* QString response;
        if (reply) {*/
            if (reply->error() == QNetworkReply::NoError) {
                QString result = reply->readAll();
    
                /*const int available = reply->bytesAvailable();
                if (available > 0) {
                    const QByteArray buffer(reply->readAll());
                    response = QString::fromUtf8(buffer);
                }*/
            } else {
                int errorCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
                qDebug() << errorCode << endl << reply ->errorString();
            }
    
            reply->deleteLater();
        }
    
    void ApplicationUI::onSystemLanguageChanged()
    {
        QCoreApplication::instance()->removeTranslator(m_pTranslator);
        // Initiate, load and install the application translation files.
        QString locale_string = QLocale().name();
        QString file_name = QString("UsernamePHP_%1").arg(locale_string);
        if (m_pTranslator->load(file_name, "app/native/qm")) {
            QCoreApplication::instance()->installTranslator(m_pTranslator);
        }
    }
    

    Heres my hpp

    #ifndef ApplicationUI_HPP_
    #define ApplicationUI_HPP_
    
    #include 
    
    namespace bb
    {
        namespace cascades
        {
            class Application;
            class LocaleHandler;
        }
    }
    
    class QTranslator;
    
    /*!
     * @brief Application object
     *
     *
     */
    
    class ApplicationUI : public QObject
    {
        Q_OBJECT
    public:
        ApplicationUI(bb::cascades::Application *app);
        virtual ~ApplicationUI() { }
    public:
        Q_INVOKABLE void post(const QString &fullName, const QString &email, const QString &password);
    
      Q_SIGNALS:
                void complete(const QString &info);
      private Q_SLOTS:
                void postFinished();
    
    private slots:
           void onSystemLanguageChanged();
    
    private:
        QTranslator* m_pTranslator;
        bb::cascades::LocaleHandler* m_pLocaleHandler;
    };
    
    #endif /* ApplicationUI_HPP_ */
    

    and this is my my main.qml

    Button{
                id : button
                text : "Register"
                onClicked: {
                   MyApp.post(tf1.text,tf2.text,tfpass.text)
    
                }
                horizontalAlignment: HorizontalAlignment.Center
            }
    

    I need to send the parameter to http://www.rws.rajaspot.com/rs_usermanagementclient.php

    but its like divider by 2, the parameter 'method = rsnewuser' and the content is fullName, email, and password

    What a success, it will show on http://www.rws.rajaspot.com/rs_userclient.php but I try this error code again

    any ideas what should I do?

    Thank you

    I mean not to define QNetworkAccessManager inside the function.

    For example:

    Declare the pointer to QNetworkAccessManager in your header file (all)

    QNetworkAccessManager *connection;
    

    and then set it in the constructor of the app inside the function you or you. In the second case, you must remove QNetworkAccessManager pointer after postFinished. (connection-> deleteLater())

    connection = new QNetworkAccessManager(this);
    

    and the full code of the POST function

    ...post(const QString &fullName, const QString &email, const QString &password)
    {
        QUrl url("http://www.rws.rajaspot.com/rs_usermanagementclient.php");
    
        QUrl postParams;
        postParams.addQueryItem("method", "rsnewuser");
        postParams.addQueryItem("fullName", fullName);
        postParams.addQueryItem("email", email);
        postParams.addQueryItem("password", password);
    
        QNetworkRequest req(url);
        req.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
    
        QNetworkReply* reply = connection->post(req, postParams.encodedQuery());
        bool ok = connect(reply, SIGNAL(finished()), this, SLOT(postFinished()));
        Q_ASSERT(ok);
        Q_UNUSED(ok);
    }
    

    It may be useful

     

Maybe you are looking for

  • Case of the suitable laptop...

    Wonder if anyone knows of a padded envelope that I can put my laptop, but still allows the laptop be opened and used. As the former mobile phone cases.

  • Why the VI begins to break when I get the property nodes?

    Hello I am an engineering student and have to do a job in labview. It is a Signal Generator with osciloscope integrated. The VI worked fine ultil I add nodes property to change wavegraph scales and the departure of VI breaking with them. Can anyone s

  • What are the differences between Windows 7 and Windows 8?

    What are the new features coming in windows 8? How is - this windows 8 is going to be better than winows 7? What are the main differences between winows 7 and winows 8? It'll be a mojor design?

  • laptop is no longer connect with my TV using a HDMI cable

    He works a few hours earlier, then the laptop came into fashion "sleep" after that I stopped looking, and I went on regular TV. When I tried to reconnect to watch something on the laptop, it would not connect more... it just says: NOT of SIGNAL, whil

  • System Restore doesn't have restore points. What should I do?

    Original title: System Restore problem Why my "System Restore" gets none of the restore points? I've restored this computer before. Any suggestions as to why would be very appreciated. Thanks Jack