How to send Array data using Post Method?

Var array = $_POST['myData'];
array[0] => 'ABC'
array[1] => 'DEF'
how to improve this code to support send array data...?
String url ="http://xxxxx/test.php";
String[] arraystr={"ABC", "DEF", "EDFF"}
String parameter = "myData=" +arraystr;    // no support this
Strint str = postMrthod(url, parameter );
public static String postMethod(String url, String parameter) {
        StringBuffer b = new StringBuffer("");
        HttpConnection hc = null;
        InputStream in = null;
        OutputStream out = null;
        try {
            hc = (HttpConnection) Connector.open(url);
            hc.setRequestMethod(HttpConnection.POST);
            hc.setRequestProperty("CONTENT-TYPE", "application/x-www-form-urlencoded");
            hc.setRequestProperty("User-Agent", "Profile/MIDP-2.0 Configuration/CLDC-1.0");
            out = hc.openOutputStream();
            byte postmsg[] = parameter.getBytes();
            for (int i = 0; i < postmsg.length; i++) {
                out.write(postmsg);
out.flush();
in = hc.openInputStream();
int ch;
while ((ch = in.read()) != -1) {
b.append((char) ch);
} catch (IOException e) {
e.printStackTrace();
try {
if (in != null) {
in.close();
if (hc != null) {
hc.close();
} catch (IOException e) {
e.printStackTrace();
return b.toString().trim();

yes, you can send integer value like this. But I think you have to put quotes around <%= TAMID%> i.e.
<input type="hidden" id="HTTP_CVHTAMID"
name="HTTP_CVHTAMID" value= "<%= TAMID%>" >

Similar Messages

  • How to send recomposed data in post method.

    Currently, i try to build up MVC user authentication. I used login.html as View, servletA as controller to invoked Model and servletB as Model. The servletB will return queried result to servletA then servletA will decide redirected to specific url.
    I has successful use the RequestDispatcher.forward(request, response) to post data from servletA to servletB. whereas i faced a trouble to post data back from servletB to servletA, which i unable put the queried result into request obj before post it back to servletA.
    Any genius recommendation about this? or Any method composed data to send via post method?

    Here's a quick rundown that might help:
    Use request.setAttribute() to put an item in request scope in a servlet before dispatching to another servlet or JSP.
    Use <useBean> tag in a JSP to read the data on the JSP that the servlet put in request scope.
    Alternatively, you can use request.getAttribute(), but the useBean is preferred.
    Use request.getParameter() in a servlet to read data that the <form> tag on the JSP page put in request scope.
    Use request.setAttribute() and request.getAttribute() to get send/get data between servlets (it could be request.getParameter(), but I dont think so).
    There is a RequestDispatcher.forward() and a RequestDispatcher.include(). I'm not sure what the differences are (you'll have to research it.
    In MVC, I have a single servlet for the controller (receive all url's, and dispatch to the appropriate JSP). I dont hava a separate servlet for the model. Instead, I instansiate a business object on the servlet, pass data to it, and let it do the calcuations. Then I have it return the data to the servlet which puts it in request scope for the JSP page when I dispatch to it. My MVC usuallyconsists of:
    JSP -presentation layer
    servlet - control layer
    business logic layer
    database layer (DAO).
    Each layer does not contain the functionality of one of the other layers (clean separation of concerns).
    Last note: Whereas you can use a servlet for the controller, a framework such as Spring or Struts is often used instead.

  • IN ODATA, How to pass Timestamp data using POST method

    Dear all
    I am trying to insert a record into a HANA column store table using ODATA service.
    POST URL
    http://hanadrp.sial.com:8000/sial/sapnext/generic/odata/uidatetime.xsodata/UIDateTime
    Message one
      "IDTXT" : "1",
      "IDDATETIME" : "2014-09-19 10:20:10"
    Message Two
      "IDTXT" : "1",
      "IDDATETIME" : "/TO_TIMESTAMP(CURRENT_TIMESTAMP)/"
    Both give me this message
    <?xml version="1.0" encoding="utf-8" standalone="yes"?>
    <error
        xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
        <code/>
        <message xml:lang="en-US">Syntax error at position 0.</message>
    </error>
    The table here has only two columns and the IDDATETIME is a column of time TIMESTAMP
    Please advice

    Thanks Shreyansh to take time to reply
    Here below is the preview of the message from the POSTMAN preview button
    I really am not sure what is the X-CSRF token?
    POST /sial/sapnext/generic/odata/uidatetime.xsodata/UIDateTime HTTP/1.1
    Host: hanadrp.sial.com:8000
    Authorization: Basic YXJhbWFjaGE6U3JpcmFtNjY=
    Content-Type: application/json;charset=utf-8
    Cache-Control: no-cache
    { "IDTXT" : "1", "IDDATETIME" : "2014-09-01T00:00:00" }

  • How to use POST method to send & recieve XML data in WebDynpro application

    Hi There,
    How can we use POST method in a Url (callign weebdynpro application) and pass XML String content. How can we read this this inside WD Application.
    Any pointers will be great help.
    Rgds

    Closed

  • Sending XML messages from server to client using POST method

    Dear everyone,
    I have a simple client server system - using Socket
    class on the server side and URLConnection class on
    the client side. The client sends requests to the
    server in the form of an XML message using POST method.
    The server processes the request and responds with
    another XML message through the same connection.
    That's the basic idea.
    I have a few questions about headers and formats
    especially with respect to POST.
    1. In what format should the response messages from the
    server be, for the client? Does the server need to
    send the HTTP headers - for the POST type requests?
    Is this correct?:
       out.println("HTTP/1.1 200 My Server\r");
       out.println("Content-type: text/xml\r");
       out.println("Content-length: 1024\r");
       out.println("\r");
       out.println("My XML response goes here...");2. How do I read these headers and the actual message
    in the client side? I figured my actual message was
    immediately after the blank line. So I wrote
    something like this:
       String inMsg;
       // loop until the blank line is through.
       while (!"".equals(inMsg = reader.readLine()))
          System.out.println(inMsg);
       // get the actual message and process it.
       inMsg = reader.readLine();
       processMessage(inMsg);But the above did not work for me. Because I seem to
    be receiving a blank line after each header! (I suppose
    that was because of the "\r".) So what should I do?
    3. What are the different headers I must pass from
    server to the client to safeguard against every
    possible problem?
    4. What are the different exceptions I must be prepared
    for this situation? How could I cope with them? For
    example, time outs, IOExceptions, etc.
    Thanks a lot! I appreciate all your help!
    George

    hello,
    1) if you want to develop a distributed application with XML messages, you can look in SOAP.
    it's a solution to communicate objects distributed java (or COM or other) and it constructs XML flux to communicate between them.
    2) if it can help you, I have developed a chat in TCP/IP and, to my mind, when you send datas it's only text, so the format isn't important, the important is your traitement behind.
    examples :
    a client method to send a message to the server :
    public void send(String message)
    fluxOut.println(message);
    fluxOut.flush();
    whith
    connexionCourante = new Socket(lAdresServeur, noPort);
    fluxOut= new PrintWriter( new OutputStreamWriter(connexionCourante.getOutputStream()) );
    a server method in a thread to receive and print the message :
    while(true)
    if (laThread == null)
    break;
    texte = fluxIn.readLine();
    System.out.println(texte);
    that's all ! :)
    If you want to use it for your XML communication, it could be a good idea to use a special message, for example "@end", to finish the server
    ex :
    while(true)
    if (laThread == null)
    break;
    texte = fluxIn.readLine();
    // to stop
    if (texte.equals("@end"))
    {break;}
    processMessage(texte );
    hope it will help you
    David

  • Want to send information in Header dynamically using HTTP adapter using post method

    Hi ,
    I have a requirement to send below information in http Adapter header dynamically using post method. which will be authenticated by third party system.
    Authorization : WSSE realm="SDP", profile="UsernameToken", type="AppKey" X-WSSE : UsernameToken Username="XXXX", PasswordDigest="Qd0QnQn0eaAHpOiuk/0QhV+Bzdc=", Nonce="eUZZZXpSczFycXJCNVhCWU1mS3ZScldOYg==", Created="2013-09-05T02:12:21Z"
    I have followed below link to create UDF
    http://scn.sap.com/thread/3241568
    As if now my third party system is not available while sending request I am getting 504 gateway error. is there any approach I can validate my request is working fine?
    Regards,

    Hi Abhay,
    Correct me if I'm wrong but I think WSSE requires a SOAP Envelope. If that is the case, there are two approaches: the first one is to use SOAP Axis and the second one is just to build SOAP Envelope via Java mapping.
    You also need to test it successfully externally, capture the request and replicate it in XI.
    Hope this helps,
    Mark

  • Hi friends, How to send any data (even binary) through XI, without using

    1) How to send any data (even binary) through XI, without using the Integration Repository .?

    hi ganga,
    Yes; 
    1. we can test adapters very easily and quickly without any IR development.
    2. we can send any formatted data without having to convert it to XML and back again, e.g. file->XI->file.
    3. we can send any document from 1 sender to multiple receivers using XI to guarantee delivery.
    /people/william.li/blog/2006/09/08/how-to-send-any-data-even-binary-through-xi-without-using-the-integration-repository
    the process integration layer of the NetWeaver  define/reuse interface objects for the SAP Integration Repository. These objects include Business Scenarios, Business Processes, Message Interfaces, Message Types, Data Types, Message Mappings, and Interface Mappings. The application developer refers to these objects in defining the interactive flow between applications for the SAP Integration Directory.
    regards,
    nikhil

  • How to resolve error while importing data using IDoc method in LSMW ?

    Hi
    I am trying to import my data using IDoc method in LSMW.
    But after completing the whole LSMW process, when I look into the IDOC generated, the error description is as this.
    It talks about the process code and other stuff.
    Function module not allowed : APPL_IDOC_INPUTI
    Message No. B1252
    Diagnosis :
    The function module APPL_IDOC_INPUTI and the application object type which were determined are not valid for this IDoc.
    I am not able to resolve the problem.
    Please help.
    Regards,
    Rachesh Nambiar

    check the below link.
    /people/stephen.johannes/blog/2005/08/18/external-data-loads-for-crm-40-using-xif-adapter

  • How to use post method in j2me

    I used post method and when im about to receive the response from the servelt i get the output like
    str=<html><head><title>Apache Tomcat/4.1.24 - Error report</title><STYLE><!--H1{font-family : sans-serif,Arial,Tahoma;color : white;background-color : #0086b2;} H3{font-family : sans-serif,Arial,Tahoma;color : white;background-color : #0086b2;} BODY{font-family : sans-serif,Arial,Tahoma;color : black;background-color : white;} B{ ................                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Thanks supareno I have tried the weblink u hav given. It helped me a lot

  • [REPOST]How to force ADF Dialog / POPUP to use POST method ?

    Hi all,
    Is there any way to make ADF Dialog / POPUP to use POST method ?
    I need that approach to implement this post : [SOLVED] Faces - Preventing user from entering URL manually
    But it breaks in my application because ADF Dialog / POPUP is using GET method.
    Thank you very much,
    xtanto

    repost.
    Thank you

  • How to send array of bytes to a servlet and store it in a file

    Hi,
    How to send array of bytes to a servlet and store it in a file.
    I am new to Servlets. if possible for any one, please provide the code.
    Thanks,
    cmbl

    Through HTTP this is only possible with a POST request of which the encoding type is set to multipart/form-data. You can use Apache Commons FileUpload to parse such a multipart form data request into useable elements. From the other side (the client) you can use a HTML <input type="file"> element or a Java class with Apache Commons PostMethod API.
    You may find this article useful: http://balusc.blogspot.com/2007/11/multipartfilter.html

  • HTTP Transformation using POST Method

    Hi, I will have to use POST method with header as application/json to get the results in http transformation. I downloaded the RESTFUL client utility from Chrome, to see how JSON would look like by passing parameters and the result is displayed as expected.  But I'm not sure how the URL to be constructed in HTTP transformation and appreciate if you have any suggestions. My URLL http://dev1.com/contract-api/contract/public/contractValidationMy input parameters:  {"hierarchies":[10],"properties":[18],"licId":123} If I use the above URL and parameters in RESTFUL client, I'm getting the output, but having difficulty in setting up the URL using HTTP transformation.  RegardsSelva

    Thanks Marc.
    Let me rephrase the scenario.
    I have an external application which is capable of sending information only in XML through HTTP requests. It does not send SOAP messages. I guess in this case, we would need to use the HTTP binding using POST method. Much like the sample at http://blogs.oracle.com/reynolds/2005/09/invoking_bpel_from_an_html_for.html which uses the GET method.
    In this sample reynolds is using the GET method. I have been trying to get the POST method to work.
    Regards
    John

  • HTTP Binding using POST Method

    Hi all,
    I need to pass XML to a BPEL using HTTP POST. I have got a sample running for passing information to BPEL through GET method of HTTP. But do not have any idea about how to pass XML using HTTP POST. Please put forward your suggestions.
    Thanks.
    John

    Thanks Marc.
    Let me rephrase the scenario.
    I have an external application which is capable of sending information only in XML through HTTP requests. It does not send SOAP messages. I guess in this case, we would need to use the HTTP binding using POST method. Much like the sample at http://blogs.oracle.com/reynolds/2005/09/invoking_bpel_from_an_html_for.html which uses the GET method.
    In this sample reynolds is using the GET method. I have been trying to get the POST method to work.
    Regards
    John

  • How to send the data from mac pc to External drive

    how to send the data from mac pc to External HDD
    or Pen Drive but with out deleting the preview as data

    You can use "Finder", which is in your dock, to copy files from your iMac folders over to the external hard drive.
    Hope this helps

  • Open URL, use POST method in new window

    From a Java program, how do we open a https connection, basically a secured site, in a new window and pass some parameters to the link, using POST method?

    Hi
    Is JavaProgram a Applet or Servlet?
    Opening a new window directly from server,probably not possible? From your question
    what I understand is, A html page is displayed
    and when u click on a link opens a new window.
    The parameters to the link should be posted using POST method, again
    it is not possible this can be done only by appending
    "?name1=value1&name2=value2..."to the link
    Vinay
    [email protected]

Maybe you are looking for

  • How to manage my photo library on iPad

    Hi, I've been traveling and now i have a few GB's of photos to select. It would be easier for me to import and select these photos on my iPad and then an then export them to my library. My photo library its stored on a PC. I've been testing the best

  • The power cord light?

    my macbook pro is a work of perfection - i love this baby - lately, my power cord light turns off at random times. what does this mean?

  • In which table can I find the value of em/total_size_mb?

    Hi, I want to write a little report that lists a few distinct parameters. Most of them one can find in TPFYPROPTY but I don't know where to look for em/total_size_mb. I know that RSPARAM shows the value of em/total_size_mb but until know i did not fi

  • Newbee question - save as flv

    I managed to make a simple animation and now want to save as flv or fl4. I looked at the various Save As and Export choices under the File menu, but don't see a way to save as flv or fl4. I would greatly appreciate it if anyone can help.

  • DB12&DB13 access issue

    Hi, when user executes DB12, DB13 T-code , user is getting error "you are not authorised to execute transaction". but when he executed SU53 tcode getting report is showing object "S_ADMI_FCD" with value DBA in BI system. what could be the reason the