HTTP request with parameters

Help, please!

I am currently working on a version of BB10 to an existing application. The application calls a Web service with parameters (including a key). The service then returns the data. It works very well on java with HttpConnection. I'm having a hard time doing the same thing in c ++. I am following the tutorial here:

https://developer.BlackBerry.com/Cascades/documentation/device_comm/networking/tutorial_http_comm.ht...

It works very well for URLS with the format:

""http://developer.blackberry.com/cascades/files/documentation/images/model.xml " "

But what happens if my URL looks like this:

"http://developer.blackberry.com/cascades/files/documentation/images/getModel?serviceKey=0xd2341ed0d0... ".

How to pass the parameter "serviceKey"?

If you use the url that you have shown, did you get a response in your browser?

Tags: BlackBerry Developers

Similar Questions

  • Is it possible to make the http request with a part without the app?

    If this is the case, then could you give me a simple example to achieve with c ++?  I tried to write #include on top but he says

    ../src/service.cpp:20:33: fatal error: QNetworkAccessManager: No such file or directory
    

    When I create an instance of QNetworkRequest.

    Thank you very much!

    Looks like you need to include the appropriate library.
    try adding - lbbnetwork in the .pro

  • Suggestions to overcome this problem: a bug with the HTTP PATCH request with data on the body

    Hello guys,.

    I'm really stuck with a problem and I'm looking for suggestions for solutions and help implementingit.

    In summary:

    (1) the third REST API that I use use HTTP PATCH with the JSON data.

    2) there is a bug in Qt 4.8 that prevents me from using the http verb.

    (3) one of the main features of my new app is severely compromised because of this.

    (4) I found an independent patch to the bug in question.

    What are my options now?

    (A) should I patch Qt reconpile and 1980s, me with my application? I have no experience with these procedures.

    (B) is it possible that I can only implement the elements of fastening of the patch in my application code? I don't see how.

    (C) request and wait for BlackBerry for the patch and release it on the next update? That imensily would limit my clients, only running 10.3.3 and I was 10.3.0.

    (D) any other alternative!

    As I said, I'm really stuck now. I was able to realease my app without this big news, but it would be a great disappointment.

    Any help is appreciated.

    Thanks in advance.

    Here's the code in a Stackoverflow thread on the same topic, I can't try it myself, but let us know if it works and mark @oniongarlic response as a solution if it works.

    Thread: http://stackoverflow.com/questions/34065735/qnetworkaccessmanager-how-to-send-patch-request

    Code:
    QString destination ="";
    currentNode.replace(QString("/").append(latestNode),""); "
    destination
    . Append (Host)
    . Append (CurrentNode)
    . Append(".) JSON");
    QString jsonString=QString(QString("{").append("\"").append(latestNode).append("\"").append(":").append("\"").append(str).append("\"").append(QString("}")));)
    QNetworkRequest request (destination);
    request.setHeader (QNetworkRequest::ContentTypeHeader,
    "application/x-www-formulaires-urlencoded");
    qDebug()<>
    QBuffer * buffer = new QBuffer();
    buffer-> open ((QBuffer::ReadWrite));))
    buffer-> write (jsonString.toUtf8 ());
    buffer-> seek (0);
    Manager-> sendCustomRequest (request, "PATCH", buffer);
    qDebug()<>

  • Http request message with BB10 Simulator test

    Hi all

    I implement request to send http request and receive the response from the server.

    Earlier for testing with simulators, we used MDS for the connection to the server.

    How to test this application using Simulator BB10 Alpha? Kindly let me know.

    Thank you and best regards,

    Shubhangi

    Hello

    I use more kink for reference: it is very useful.

    https://developer.BlackBerry.com/Cascades/documentation/device_comm/networking/tutorial_http_comm.ht...

    Also in my code, it was typo. Now the http request has been published to server correctly.

    Thank you and best regards,

    Shubhangi

  • Today, I have a problem with the HTTP request

    Well, this time, I try to get an image .png from a URL. To get this I do the following:

    try{   if (CoverageInfo.isOutOfCoverage()){      setError("No hay covertura suficiente de la red");        errorFlag = true; } else{     c = (HttpConnection)Connector.open(url);      is = c.openDataInputStream();     for(int j=0;j
    

    My problem is the second 'try' returns: "java.lang.illegalArgumentException". I don't really know much on HTTP conections, so I don't know that I have a lot of wrong code

    in other words, I'm moving to the java language this short code on the C++ language:

    WebRequest request = System.Net.WebRequest.Create(url);HttpWebResponse response = (HttpWebResponse)request.GetResponse();Stream datos = response.GetResponseStream();Imagen = new Bitmap(datos);pb1.Image = Imagen;datos.Close();response.Close();
    

    can someone help me?

    Thank you RexDoug and peter_strange,

    in the book "java J2ME a tope"-unfortunately or fortunately (for me), it is in Spanish - explain everything about HTTP request and how to interpret correctly the answer. Finally with the following code, I solved my problem:

    try{
        //ask if i have coverage
        if (CoverageInfo.isOutOfCoverage()){
            setError("No hay covertura suficiente de la red");
            errorFlag = true;
        }
        else{
            //create connection
            c = (HttpConnection)Connector.open(url);
            c.setRequestMethod(HttpConnection.GET);
            is = c.openInputStream();
    
            //process response
            if(c.getResponseCode()==HttpConnection.HTTP_OK){
                size = (int)c.getLength();
                if(size != -1){
                    data = new byte[size];
                    is.read(data, 0, data.length);
                    imagen = Bitmap.createBitmapFromBytes(data, 0, -1, 1);
                }
                else{
                    ByteArrayOutputStream byteArray = new ByteArrayOutputStream();
                    int stream;
                    while((stream=is.read())!=-1){
                        byteArray.write(stream);
                    }
                    data = new byte[byteArray.size()];
                    data = byteArray.toByteArray();
                    byteArray.close();
                    imagen = Bitmap.createBitmapFromBytes(data, 0, -1, 1);
                }
            }
            //close connections
            c.close();
            is.close();
        }
    }
    

    This code is similar to the example of rexdoug.

  • I need assistance with the HTTP request procedure

    This is the message I get debug, attempting a HTTPService request as follows
    < mx:Application... initialize = "myService.send ()" >
    Import mx.rpc.events.ResultEvent;
    < mx:HHTPService id = "myService" url = "" data / myInfo.xml "result =" resultHandler (event) "/ >:"

    [SWF] C:\Documents and Settings\ArchiMaster\My Documents\Flex Projects\krsl_corp\bin-debug\krsl_corp.swf - 786 719 bytes after decompression
    [Fault faultString = "HTTP request error" RPC faultCode = "Server.Error.Request" faultDetail ="error: [IOErrorEvent type ="ioError"bubbles = false cancelable = false eventPhase = 2 text =" Error #2032: stream error. "]] ["URL: file:///C:/Documents%20and%20Settings/ArchiMaster/My%20Documents/Flex%20Projects/krsl_cor p/bin-debug/data/ilungas.xml"]. ["URL: data / ilungas.xml"]
    to mx.rpc::AbstractInvoker / http://www.adobe.com/2006/flex/mx/internal:faultHandler () [E:\dev\3.0.x\frameworks\project s\rpc\src\mx\rpc\AbstractInvoker.as:216 ]
    at mx.rpc::Responder/fault() [E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\Responder.as:49]
    at mx.rpc::AsyncRequest/fault() [E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\AsyncRequest .as:103]
    to DirectHTTPMessageResponder / errorHandler ([E:\dev\3.0.x\frameworks\projects\rpc\src\mx\mes saging\channels\DirectHTTPChannel.as:343])
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/redirectEvent()

    What it means? In addition, I do not use the default workspace, so Flex created only the ".metadata' but not the 'configuration' file, that is why, I had to copy a block as the default workspace. So, how do you get Flex to create two files no matter the location of the workspace? I really need help. Thank you!

    Looks like the error message saying that "data / ilungas.xml ' was not found. You use url = "" data / myInfo.xml ' in your service. " They do not match.

  • signature of the oversized https request

    Hi, is it possible that we can trigger an alarm when an https request exceeds a certain size?

    I can define a type state.http signature using parameters such as the following? MaxRequestFieldLength takes into account the fragmentation of application data by ssl?

    -Direction = ToService

    -MaxRequestFieldLength = 1000000

    -servicePorts = 443

    -AlarmThrottle = FireOnce

    -MinHits = 1

    -ResetAfterIdle = 15

    -ThrottleInterval = 15

    -WantFlag = TRUE

    If this does not work, would you please suggest alternatives. Thank you.

    I looked into it, and it does not seem that this will really be feasible with the help of a personal signature. First, you must use the STRING. TCP engine for this. THE STATE. Engine HTTP needs context information in the HTTP stream in order to work properly. Because the HTTPS protocol is encrypted traffic, we have not these signals. So there's basically trying to count bytes in a HTTPS stream. Two problems here. First of all, the implementation of regex in STRING. TCP is limited to 512 ~ States for performance reasons. So, we will build only a model to 512 or more characters. This obviously does not follow the large desired patterns. Secondly, we need some sort of condition of single endpoint, a character model, at the end of the regex model with. Due to the random nature of characters in the encrypted HTTPS data, we do not have the guarantee that our terminator will not unexpectedly appear in the stream for giving us no good way to determine, we have reached the end of the search. This signature will probably be coded in a new engine.

  • How to send a document in net. HTTP.request as a POST variable?

    I have read and reread the doc on the net. HTTP.request and he says I can pass an argument to oRequest, but I failed to pass in the current document, which is what I want to do.

    I tried app.activeDocs [0], or the encoding of a string, but if he makes the call with no error, nothing is sent.

    ORequest must be a single document, or a variable consisting of name-value pairs? How to send multiple parameters to a POSITION otherwise?

    I did very well with the call using GET, but when I tried to send the document as a GET variable, I did nothing either.

    I send to an end point of LiveCycle REST so either POST or GET is fine.

    Thank you!

    Validating the document current is simple * provided * your script runs outside the context of the document (i.e. in the console or a script to the folder level). There is no access to scripts of doc-level for obvious reasons.

    For example, put this in the console JS OCCURS the current file to a URL:

    Net.HTTP.request ({}

    cVerb: 'POST',

    cURL: "http://localhost/submit.php."

    oRequest: Collab.documentToStream (this);

    oHandler: {}

    answer: function (msg, uri, err) {}

    If (err! = undefined) app.alert (msg);

    }

    }

    });

    Your problem talking to a vanilla Web service, is that you can send the RFC1867 delimiters (i.e. the form apply for "multipart/form-data") that the ReadStream object is not a method of concatenation in the JSAPI Acrobat. It's also how you would usually precede other fields in the form, but if you are careful with your codes side server that you can send to save them as GET parameters in cURL. Normally, you'd be polite and passed a context of Type in the table of aHeaders header - it won't matter for the transmission process, but will allow your webservice predict what that heck he was sent.

    Your webservice will then read the raw data. PHP for example, you will get nothing in the $_FILES global, but you can grab the PDF by reading all of the input buffer, with the line:

    $pdf = file_get_contents() ("php://input");

    If this line was in the server script which was the JS code above, the variable $pdf will contain an exact binary copy of the currently opened document.

  • Branch to the Page identified by the element with parameters

    A certain page we originally had a 'branch at or the Page URL' that has parameters associated with it (which one who reset the element on the page the branch goes back to the current value of the item page before branching him given that this necessary element to stay with the current value of population but was erased when he branched out) but now I have a new Application process that defines an element of the request for the page that should be branched to.

    Since Apex does not recognize the elements of the Application in a "branch of Page or URL", I need to create a "branch of Page identified by Item", the problem is that there is no "Set these elements" "with these values" with this type of branch or the option to include parameters in a URL target. I already tried to use the "branch Page or the URL" with the Application in the URL element, but that no longer works.

    Any suggestions on how I might branch to a page based on an element of the Application (if not this way, somehow creates a branch to a page based on a value in an application process) with the settings?

    What does not make sense to me, is that you could create a branch to a Page with a value of Page element with parameters defining the elements with certain values, but you can do this when identified by the item or it is not yet Application_Items in a Branch_to_Page/URL.

    Thank you in advance,
    -Brian

    Brian,

    Have you tried to use the Type of the branch "Branch to the Page identified by the (name of the use element) element" and put the name of your APP_ITEM like

    APP_ITEM

    ?

    This should work for you.

    Denes Kubicek
    ------------------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Opal-consulting.de/training
    http://Apex.Oracle.com/pls/OTN/f?p=31517:1
    ------------------------------------------------------------------------------

  • Firefox abandons his silently http request within 60 seconds

    • Summary

    Firefox abandons its http request in nearly 60 seconds (period till)
    waiting time varies) and says nothing to users. This has happened at a time of
    Nginx and Apache.

    • Environment

    Client browser: Firefox 35.0.1
    Client OS: Windows 7 Enterprise 32-bit SP1
    Web server: Apache 2.2.3 - 91 & 1.6.2 - 1 of Nginx
    Server operating system: CentOS 5.11
    PHP: 5.3.3
    FastCGI: spawn-fcgi(3) - 1.6.3 - 1

    • Description of the problem

    I noticed that nginx record 499 http response code so often.

    Nginx is used almost only to two web applications, one based on PHP
    and others on ruby. We encounter this problem in both applications. The server and the client PC belong to the same subnet.

    Since last month, nginx logged 624 errors for Firefox and 16 others
    browsers (IE, almost).

    For the test, so I wrote a simple PHP (see bottom of article) and I tried to access
    Thanks to these two Apache and Nginx with 35.0.1 Firefox and IE 11. IE11
    waited for 120 seconds and returned html successfully through two nginx
    and Apache, but Firefox has failed or the other.

    Let me describe the behavior of Firefox.

    1. Enter the test php url in the address bar, and then press ENTER.
    2. the message "waiting for response from the server" appears in the status bar for a while.
    3. watch the conversation network through Wireshark, signals 'Keep Alive'
    are repeated several times between server and client, and after that,
    4. the message disappears. 'END' signal is sent to the server, the client, just after that. Firebug newspapers 'Aborted' to the almost at the same time.
    5. the responses from the server ' END ACK.

    There is a difference of bit with nginx and Apache behavior after ' END
    ACK "."

    A.Nginx

    Nginx logs '499' error and end the conversation immediately.

    B.Apache is not connect anthying at this stage. After 120 seconds (sleep timer
    in PHP) of the request, it returns html expected. Of course Firefox doesn't make it, but I could confirm both request and response of the "Follow TCP Stream" of Wireshark function. Finally, it is saved with the http status code 200 to the httpd log file.

    I repeated this test several times. Actual expiration time varies from 22
    70 seconds but the results are the same.

    To my knowledge, the browser should display "timeout error".
    After such a situation, but it only shows nothing. If the end user does not
    find out what happened.

    ---

    • What I tried to solve the problem
    • Disable all other than firebug extensions.
    • 'network.tcp.keepalive.enabled' set to false in: config.
    • the value "network.http.spdy.enabled" fake, too.
    • the "network.http.response.timeout" value 0.
    • Mobile IPV6 and DNS prefetch, seeing what follows to help.

    https://support.Mozilla.org/en-us/KB/websites-Don

    • past Timeout to 0 to http.conf to apche.

    My goal is to make our web applications to work correctly in our work environment. I have recommended Firefox to colleagues because it was a very cool application. Change the default brawser is a nightmare for me. Any suggestions are welcome.

    ---
    < php test >
    Sleep (120);
    echo time();

    Dear jscher2000

    I saw your site with my Firefox twice and there is no expiration time. After 120 seconds, Firefox has made text "sleep 120 seconds before generating the HTML."

    If this isn't the problem in Firefox, but our network or server or both of them.

    Thanks to you all. I will try to pinpoint the cause of our problem.

  • HP 40GS systems of linear equation with parameters

    Hello

    I'm in the learning curve of the HP 40GS - a very interesting tool.

    Is it possible to solve systems of equations with parameters, for example:

    A * X + Y = 2 * 12

    5 * X - 3 * A * Y = 5

    HP 50 g, this isn't a big deal, but with HP 40GS I don't have an idea so far.

    If this is not possible, it will be possible if I have a third equation (so 3 equations in 3 unknowns)?

    Thank you very much in advance,

    Joachim

    P.S.: So far, I feel very comfortable with the HP 40GS and menus!

    ----------------------------------------
    I am not a member of the HP Calculator development team - unfortunately!

    Hello

    now, I found a way to calculate the systems of equations with symbolic coefficients:

    See the document: http://www.hp.com/ctg/Manual/c00829737.pdf to page 346ff

    With the command 'linsolve', it is possible to calculate with more unknown than equations.

    I hope this helps anyone with the same or close problem.

    Have fun with your calculators and do not hesitate to write other ways of calculations.

    Greetings,

    Joachim

  • How can I send a HTTP request to a web server using TCP?

    I'm writing a HTTP string to activate a script CGI, server of our company. It seems that the OPEN TCP CONNECTION works. Can I just use the TCP WRITE function to send the HTTP request string to the server?
    Thank you
    Tim

    I know that I probably would have finished faster if I had the Internet Toolbox, but the solution ends up being pretty simple with just the TCP features.
    Here is the solution, I came with yesterday (in the case where someone else needs) after searching Protocols TCP as suggested by "Laboratory Viewer" and examine details in the riding of developer. It ends up being only a string of 4 line.

    GET HTTP://proxyserver/path/file.asp?id=test HTTP/1.1
    HOMEroxyserver

    The first line of the string is made up of three things:
    (1) the GET command
    (2) the URL of the program target (in this case an ASP program that distributes a message preset)
    NOTE that in this case, the URL contained "HTTP://proxyserver" and not only the path to the file. If your not using a proxy server, you can probably omit the name of the server of the URL, but you must always the name of the host server to the second line.
    (3) the HTTP version used

    The second line is the host server.

    The last two lines are empty, but the two are apparently necessary to properly close the TCP request.

    Vi uses an OPEN TCP CONNECTION to connect to port 80, then the 4 line string is sent with a WRITING of TCP and the connection is closed with a NARROW CONNECTION of TCP.

    In my application, when the piece of equipment monitored by LabVIEW begins to enter a dangerous to use, LabVIEW uses this vi to send the HTTP request through the TCP connection and a program of target ASP on the company's web server. The ASP reads the message ID (? id = test) and sends the message page and the text messaging appropriate to maintenance and engineering personnel. People warned by text pagers are supposed to respond immediately.

    Our DSI wrote the ASP that allows you to set the ID of multiple message with different distribution lists. Each message is triggered with a different ID of the virtual instrument according to the gravity of the situation.

    Thanks to other amateurs who have published their questions and their answers. Hope someone else finds this useful.

  • Calling stored procedures with parameters with the database connectivity Toolkit

    Hi all

    I'm new to the forum and struggling to find a solution to a particular problem I have in this respect, using the LabVIEW Database Connectivity Toolkit on a project, I am currently working on my work.  I have a database in which I tables and stored procedures with parameters.  Some of these stored procedures have input, output and return parameters.

    I tried to follow this example, but to no avail: http://digital.ni.com/public.nsf/allkb/07FD130746083E0686257300006326C4?OpenDocument

    Such a stored procedure I am working on the implementation is named "dbo.getAllowablePNs", running "SELECT * from DeviceType" (DeviceType is the table).  In this case, it requires no input parameter, it has an output parameter that generates the table [cluster] and has a return parameter that returns an integer value (status code for execution) to show if an error occurred.  The DeviceType table has 3 columns; ID (PK, int not null), PN (nvarchar ((15), null) and NumMACAddresses (int, null).)  I have surpassed many examples and I talk to the support OR try to implement this and similar procedures stored in LabVIEW but have not been successful.  I am able to connect to the database with the VI of open connection without error, but spin in some confusion as a result of this step.  I then try to use the VI of parameter query create to call the stored procedure and set the parameters.  I guess I would then use the Set parameter value for each parameter that is connected to the entry of parameters on the previous query with parameters VI VI?  I am also having some confusion during and after these steps as well.  I would greatly appreciate advice or suggestions that anyone could have in this situation because I am not a SQL expert.  Also, I would be happy to provide more information that might be useful.

    Kind regards

    Jon

    Here's what I use to do this.  I think I had to change him create parameterized query VI for him to work.  There is a post on the forum about this somewhere.

  • HTTP request works does not in a Simulator

    Hi all

    am held to an odd question in the BB. My http request class always throws incorrect exception as the url. spin the MDS Server too. to send the request, I talked link http://riccomini.name/Topics/Mobile/BlackBerry/BlackBerryHTTPClient/...

    try url www.google.com... every time am getting error 400... I don't think that the url is incorrect.

    So please help me to solve the problem. Is there a problem with MDS? using jde 4.5 and 8300 simulator-based test.

    I tried the sample provided by the SDK... also for this same problem am facing

    Thanku

    Sorry not an area of expertise, but I guess you have a proxy on your network server and you must configure the MDS to work with it.  Search for proxy server, there is an article that explains how.

  • Error after http request

    Hello

    I have an application that performs an http request to a server that send to BlackBerry and BlackBerry XML parse XML with SAX. I get this error: invalid character '& #x10' encountered. Can you tell me what is this character and how I can solve it?

    Thanks in advance.

    Kind regards

    Gianni.

    I solved it adding

    conn.setRequestProperty (' x-rim-transcode-content "," none"");

    but I do not know why... May I ask why?

Maybe you are looking for