How to send parameters for POST request in AJAX?

hi friends,
I am sunil. I am working on ajax.
My problem is how to send post parameters in AJAX.
For GET request. I am using bleow and it is workin fine.
var url = "GetCurrencyRateController?currid="+CurrId+"&lncurrid="+LnCurrID;
For POST Requert i am sending as
var url = "GetCurrencyRateController";
req.send("currid="+CurrId+",lncurrid="+LnCurrID);
but it is not working

Check out the Apache HttpClient package and look for how to use the MultipartPostMethod.
Here is some sample code:
            HttpClient client = new HttpClient();
            MultipartPostMethod filePost = new MultipartPostMethod("http://localhost:8080/MyApp/Push");
            filePost.addParameter("subName", sub.subName);
            filePost.addParameter("serverName", sub.getServerName());
            File file = new File("C:/dataFile.zip");
            filePost.addParameter(file.getName(), file);
            int code = client.executeMethod(filePost);

Similar Messages

  • How to create iView for Leave Request Approval for ESS Tab in Portal

    Hello ,
    I am new to  Enterprise portal. I got a requirement for creating iViews.
    How to create iView for Leave Request Approval for ESS Tab in Portal.??
    Please give me clearly or provide any document.
    Thanks
    Risha

    Hi Risha,
    is it customized application ?
    If so in SWFVISU transaction maintaain the entry .
    Use transaction SWFVISU to prepare standard setting for your Workitem in the UWL. --Parameters for Work Item Visualization in the UWL.
    Have a look at below link
    http://help.sap.com/saphelp_nw2004s/helpdata/en/59/d516690e854c7090ae15bf492a869f/content.htm

  • Documaker : how to send Email for test

    Hi Experts,
    I want to do the test sending email from Documaker.
    I can created the HTML file, but I can not figure out how to send mail for test.
    This question might be very basic contents, but please let me know.
    Thanks,

    You can find all of the Documaker documentation online at the following link: Insurance Documentation

  • How many instance created for 100 request in servlet?

    Let me know the answer

    STM12 wrote:
    Subject: how many instance created for 100 request in servlet?
    Let me know the answerInstances of what?

  • How to send PUT, DELETE HTTP request in HttpURLConnection ?

    Hi all.
    I want to know that is it possible to send PUT, DELETE request (practically) through java.net.httpURLConnection to http based URL. I have read so many articles describing that how to send GET, POST, TRACE, OPTIONS request but still not finding any sample code which successfully perform PUT and DELETE request. Can any one give idea regarding that?
    Thanks

    Help_Me_Solve wrote:
    Hi all.
    I want to know that is it possible to send PUT, DELETE request (practically) through java.net.httpURLConnection to http based URL. I have read so many articles describing that how to send GET, POST, TRACE, OPTIONS request but still not finding any sample code which successfully perform PUT and DELETE request. Can any one give idea regarding that?
    ThanksIt's technically possible I am sure but 100% impractical because almost nobody uses an HTTP server for that purpose. I don't know what HTTP servers actually implement PUT and DELETE but you can be sure even in those that do the behaviour is off by default.
    If you need to do PUT/DELETE sort of operations you should be using FTP.

  • Re : How to send CC for mail

    Hi
           I send mail for to address using the functional module ,SO_NEW_DOCUMENT_ATT_SEND_API1,  
    Now i have to send CC also. How to do this.
    Thanks
    Anto

    HI Antony
    try this code
    DATA: OBJPACK LIKE SOPCKLSTI1 OCCURS 2 WITH HEADER LINE.
    DATA: OBJHEAD LIKE SOLISTI1 OCCURS 1 WITH HEADER LINE.
    DATA: OBJBIN LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
    DATA: OBJTXT LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
    DATA: RECLIST LIKE SOMLRECI1 OCCURS 5 WITH HEADER LINE.
    DATA: DOC_CHNG LIKE SODOCCHGI1.
    DATA: TAB_LINES LIKE SY-TABIX.
    DATA L_NUM(3).
    Creation of the document to be sent
    File Name
    DOC_CHNG-OBJ_NAME = 'SENDFILE'.
    Mail Subject
    DOC_CHNG-OBJ_DESCR = 'Delivered Mail'.
    Mail Contents
    OBJTXT = 'Object text'.
    APPEND OBJTXT.
    DESCRIBE TABLE OBJTXT LINES TAB_LINES.
    READ TABLE OBJTXT INDEX TAB_LINES.
    DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
    Creation of the entry for the compressed document
    CLEAR OBJPACK-TRANSF_BIN.
    OBJPACK-HEAD_START = 1.
    OBJPACK-HEAD_NUM = 0.
    OBJPACK-BODY_START = 1.
    OBJPACK-BODY_NUM = TAB_LINES.
    OBJPACK-DOC_TYPE = 'RAW'.
    APPEND OBJPACK.
    Creation of the document attachment
    LOOP AT ITAB_DATA.
    CONCATENATE ITAB_DATA-PRODUCTOR
    ITAB_DATA-VBELN
    ITAB_DATA-POSNR
    ITAB_DATA-MATNR INTO OBJBIN.
    APPEND OBJBIN.
    ENDLOOP.
    DESCRIBE TABLE OBJBIN LINES TAB_LINES.
    OBJHEAD = 'ORDERS'.
    APPEND OBJHEAD.
    Creation of the entry for the compressed attachment
    OBJPACK-TRANSF_BIN = 'X'.
    OBJPACK-HEAD_START = 1.
    OBJPACK-HEAD_NUM = 1.
    OBJPACK-BODY_START = 1.
    OBJPACK-BODY_NUM = TAB_LINES.
    OBJPACK-DOC_TYPE = 'TXT'.
    OBJPACK-OBJ_NAME = 'WEBSITE'.
    OBJPACK-OBJ_DESCR = 'ORDERS.TXT'.
    OBJPACK-DOC_SIZE = TAB_LINES * 255.
    APPEND OBJPACK.
    Completing the recipient list
    target recipent
    clear RECLIST.
    RECLIST-RECEIVER = 'xyz'.
    RECLIST-EXPRESS = 'X'.
    RECLIST-REC_TYPE = 'U'.
    APPEND RECLIST.
    copy recipents
    clear RECLIST.
    RECLIST-RECEIVER = 'xyz2'.
    RECLIST-EXPRESS = 'X'.
    RECLIST-REC_TYPE = 'U'.
    RECLIST-COPY = 'X'.
    APPEND RECLIST.
    Sending the document
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    DOCUMENT_DATA = DOC_CHNG
    TABLES
    PACKING_LIST = OBJPACK
    OBJECT_HEADER = OBJHEAD
    CONTENTS_BIN = OBJBIN
    CONTENTS_TXT = OBJTXT
    RECEIVERS = RECLIST
    EXCEPTIONS
    TOO_MANY_RECEIVERS = 1
    DOCUMENT_NOT_SENT = 2
    OPERATION_NO_AUTHORIZATION = 4
    OTHERS = 99.
    hope this helps
    regards
    Aakash Banga

  • How can i check for posted but not yet commited changes in a form

    Dears
    I make changes programmatically in a form then i post it using (Post built in).
    If the user exits the form, i make check for any changes in the form to commit it using the system variable :system.form_status
    Unfortunately the value of this system variable is 'Query' not 'Changed' because of using the post built in.
    Is ther another system variable ( or any another way ) that check for posted but not yet commited changes in the form ?
    Thanks a lot
    Mostafa Abolaynain

    I had faced similar situation. Using of package variable which identifies, what is the user's latest action.
    This is just a workaround.
    Capture what the user has performed into a variable say, PKG_VAR.ACTION,
    This will be assigned values like List L, and Create C, Update U and Saved S.
    If commit is executed,assing the status S to the variable.
    So while closing,
    IF :system.form_status = 'CHANGED' or PKG_VAR.ACTION in ('C','U') THEN     
    -- validate the data, n perform commit.
    else
    -- just close the form.
    end if;
    Regards
    Deepz : )

  • Sub: How to send idoc for IW31.

    Dear All,
    Content: My requirement is to send the idoc for maintanance order- IW31. I found the message type as IORDER. I am not able to use change pointer  IORDER is not matching, as i am not able to find the message type, when executing BD21 (for change pointer).
    Please let me know the procedure for sending idoc for IW31.

    This is what it worked for me, to create an INBOUND IDOC to transaction IW31:
    I converted BAPI_ALM_ORDER_MAINTAIN to an IDOC
    1) In transaction SWO1 copy model BUS2007A to ZBUS2007A (make sure set the status to implemented Edit->Change Release Status->Object type -> to implemented.
    2)In transaction BDBG, check Object type, Object ZBUS2007A, Method ORDERMAINTAIN
    you can check
    http://help.sap.com/saphelp_nw04/helpdata/en/78/21740f51ce11d189570000e829fbbd/content.htm
    I Put in Message type ZORDERMAIN
    IDoc Type ZORDERMAIN01
    the function name will be: ZIDOC_INPUT_ZORDERMAIN
    3) configure transaction BD51
    4) Configure transaction WE57
    5) Configure transaction WE42
    6) and Finally Transaction WE20
    In my case it worked, still I modified function ZIDOC_INPUT_ZORDERMAIN, and in  the call function to BAPI_ALM_ORDER_MAINTAIN I  commented the releationship tables.(They were giving me some errors)
    Hope this info will help someone.
    Regards

  • How to send Parameters FORM to PHP WEB Page with method POST (secure)?

    Hello everyone,
    i hope someone can help me to find a solution to this problem!
    i have to send "+precious+" parameters from an oracle form to php page, like username and password, with a secure method... i tried with WEB.SHOW_DOCUMENT procedure but it uses GET Method and when the web page open up you can read those parameters in the url...no good!
    some suggestion?
    Thank a lot in advance... FMicio

    The other way you have is to make a PJC java bean ...
    which uses HTTPClient library..
    for example:
    PostMethod post = new PostMethod("http://jakarata.apache.org/");
            NameValuePair[] data = {
              new NameValuePair("user", "joe"),
              new NameValuePair("password", "bloggs")
            post.setRequestBody(data);
            // execute method and handle any error responses.
            InputStream in = post.getResponseBodyAsStream();
            // handle response.I have done a multipart form data post to upload files to my db over httpClient.. and other things...
    Or with java.net.* api-s
    try {
        // Construct data
        String data = URLEncoder.encode("key1", "UTF-8") + "=" + URLEncoder.encode("value1", "UTF-8");
        data += "&" + URLEncoder.encode("key2", "UTF-8") + "=" + URLEncoder.encode("value2", "UTF-8");
        // Send data
        URL url = new URL("http://hostname:80/cgi");
        URLConnection conn = url.openConnection();
        conn.setDoOutput(true);
        OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
        wr.write(data);
        wr.flush();
        // Get the response
        BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
        String line;
        while ((line = rd.readLine()) != null) {
            // Process line...
        wr.close();
        rd.close();
    } catch (Exception e) {
    }Or you can call your web page (post data) from your database
    http://awads.net/wp/2005/11/30/http-post-from-inside-oracle/
    Edited by: Peterv6i on Mar 30, 2012 3:49 PM
    Edited by: Peterv6i on Mar 30, 2012 3:55 PM

  • How to make a HTTP Post request to a remote server ?

    Hi Guys,
    I'm new to java technology. I've a small problem with my code. All i need is to send a request to the remote server whose control is not at all in my hands with the POST method, which includes few of the parameters along with one of them is a xml formatted variable. The result of this request is an xml generated out which i want to fetch in my jsp code. I've tried it with the HTTPUrlConnection method and code for the same is below :
    <%
    try {
    String xmlString = "<FARES><AGENCY_ID>TFI</AGENCY_ID><DEP_CITY>NYC</DEP_CITY><ARR_CITY>LON</ARR_CITY><DEP_DATE>12</DEP_DATE><DEP_MONTH>DEC</DEP_MONTH><OWRT>RT</OWRT></FARES>";
    URL url = new URL("http://www.lowestairprice.com/Canada/mars.asp?WCI=Start&WCE=XMLFARES&reqMsg=Yes&");
    HttpURLConnection con = (HttpURLConnection)url.openConnection();
    con.setInstanceFollowRedirects(true);
    con.setFollowRedirects(true);
    con.setRequestMethod("POST");
    con.setDoOutput(true);
    out.println("Testing...");
    BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(con.getOutputStream()));
    bw.write("xmltekst=" + xmlString);
    bw.flush();
    bw.close();
    BufferedReader br = new BufferedReader(new InputStreamReader(con.getInputStream()));
    String line = br.readLine();
    String result ="";
    while (line !=null) {
    result += line;
    line = br.readLine();
    br.close();
    out.println("Resultat: " + result);
    } catch(Exception exc) {
    exc.printStackTrace();
    out.println(exc);
    %>
    But when i run this on browser it gives me the following error.
    java.net.MalformedURLException: unknown protocol: https
    Now the response they provide is thrown back with the https protocol instead of the http. How can i fetch their response in my jsp code and store it in a local variable.
    If anybody can help me out in this, i would be thankful for the same.
    Thanking You,
    Rgds,
    Gaurav
    (Software Engineer)
    Ultra Infotech.

    Have you tried to use HttpsURLConnection instead ?

  • How to pass parameters through POST

    Hi,
        Can any one help me how to pass the parameters and read it using POST method in webdynpro java.

    Use the following code to read URL parameters inside WDJ
    //     Check for URL parameters
           IWDProtocolAdapter protocolAdapter = WDProtocolAdapter.getProtocolAdapter();
           IWDRequest request = protocolAdapter.getRequestObject();
           String text = request.getParameter("url_parameter");
    Hope this helps.

  • TS3276 How to send a return receipt request?

    How do i set up an email to send me a notification when the recipient opens it?

    Mail doesn't nativel support such things. If this still works, you can add a header that will request the read receipt, but it will be for every email you send: http://email.about.com/od/macosxmailtips/qt/et_request_recp.htm
    Since most email clients either disable this by default or don't support it at all (like Mail), you will only know if you get a positive response. If you do not get a read receipt, it has little bearing on whether the person read the email or not.

  • How to send parameters from java to perl

    I have a java program which is executing a perl script. I m using
    Runtime.getRuntime().exec method to execute the perl script. Now I have to send some parameters to the perl script from java which will be processed there. can you help me how to do it?

    nitu007 wrote:
    Then there is no solution for this .Not true.
    Actually the perl script was preety big and to convert it to java it will take time.That's no excuse not to do it.
    So i thought i could execute it througn java.You can. CGI is basically a protocol on how to invoke programs and deal with their output; so other programs than web servers can follow it to invoke CGI scripts.
    However, (1) you may find that implementing the CGI protocol from the invoker's side may be a bigger pain than it's worth, and (2) in the long run, you'll end up with a hack that will be a pain to maintain.
    In your case, because the script uses CGI.pm, implementing the full CGI protocol probably won't be necessary. But you'll still be doing some klugery to run the CGI script at all, and you'll be buying yourself pain in the long run. Even if you do run it this way, I'd advise that once you have that working and have some breathing room, you start to work porting the script.

  • How to send more than one request parameter through a submit button?

    Hi,
    I want to send two request parameters from the JSP page to the Struts application via following tag:
    <html-el:submit property="event" value="Assign"/>
    This piece of code sends only one request parameter to the backend application: The name of the request parameter is "event" and the value is "Assign".
    However I want to send one more request parameter with each button click. How can I do this?
    Any help is greatly appreciated.

    One thing u can do is add a hidden field and set value into it. When u submit the form this value also will be available in the request object. use request.getParameter("name") to get the value.

  • How to send in for logic board / HD repair?

    Not long before my trial AppleCare expired, my MacBook Pro started doing very strange things, freezing, crashing, making grinding noises, etc. After reporting the results of Disk Utility and a hardware scan to AppleCare, they gave me a case number and said that I most likely needed both a logic board replacement and a hard drive replacement, and that if I had further trouble, to take it in for repair.
    Well, the local Apple Store's Genius Bar has been entirely booked up for two days now, and as my AppleCare trial has expired (though I'm under warrantee), I can't call Apple about it.
    Can I simply walk in and drop it off? Do I mail it to Apple myself? I've never had to send a machine in to Apple, but it's seemingly not as straightforward as I thought.... how long might I expect my turnaround time to be?
    MacBook Pro, 2Ghz   Mac OS X (10.4.7) {dying fast}

    ... as my AppleCare trial has expired (though I'm under warrantee), I can't call Apple about it.
    There's really nothing "trial" about it, although I can see how it could be perceived that way. What expired was your 90 days of free phone support for any issue with your MBP, but since, as you know, you still have a one year hardware warranty, you still have free phone support for warranted hardware issues.
    See Is phone support and warranty service free? for details.
    As Kappy indicates, it's a very straightforward process. If Apple determines that you do have a hardware defect, they'll arrange for a shipper to drop off a shipping box and take it away when you've packed your MBP, and then they'll ship it back to your door when the repair is complete.

Maybe you are looking for

  • Creation of BP through Web UI.with Life cycle stage concept.

    Hi, I am working on Life cycle stage. I have added the field " Life cycle stage" field in the Web UI. But now when i go to create a BP with a life cycle stage XXX, it throws a error saying "BP category 1 does not fit the data in category 2" and "Data

  • Customize the legend of a pie graph to show only one series

    Is there a way to show only one series in the legend though the pie graph displays more than one series? Any help is greatly appreciated Thanks KK

  • Third Party Sales Senerio

    H Guru's Company will not produce Material - A, They procure from 3rd party, one customer ordered 100 Nos of MAterial A, and raised PR and P.O for 100 Nos, and invoiced the customer for 100 Nos, and customer paid for 100 Nos, after noticed that only

  • E6 (Belle) - Phone can sent but not receive emails

    Hello, I have set up a 2nd mailbox. The first mailbox functions fine. But with the second mailbox I can send, but not receive emails. Has anybody an idea how to solve that? Many thanks

  • My Menu Bar will not recognize Firefox as the current program?

    I am having trouble with my Mac Menu Bar. Firefox is not in Full Screen mode, and the Menu Bar is visible, but it is not registering Firefox as being the current program, causing me to loose things such as "Bookmarks" and "History" or even "Force Qui