Specify 'GET' parameters in HTTPService in ActionScript?

Hi,
I was wondering if there is a way to specify variables and values in Actionscript to send in an HTTPService.  Say I wanted to send a request like:
http://mydomain.com/?user=test
In AS3, I have this:
private function init():void {
  service = new HTTPService();
  service.destination = "http://mydomain.com";
  service.method = "GET";
  service.addEventListener("result", httpResult);
  service.addEventListener("fault", httpFault);
Is there a way to use a function to specify GET variables (user=test)?  Because otherwise it become more cumbersome to keep changing the destination screen and worry about escaping variables, etc, etc.

Yes, I see that.  I just wasn't sure how to specify the parameters.  I am trying this:
var params:Object = new Object();
params.user = "test";
service.send(params);
That seems to have done it (actually, I realized I need to set the 'url' property, not the 'destination' property as well)
So I can just call this 'send' with different parameters on the same object over and over right?  Do people generally put logic in the eventlistener to differentiate the type of responses that come back, or is it more common to add different event listeners for each type of request?  In case it's not obvious, I'm making a RESTful php server that can respond to various methods in the request, modeled after the flikr API.

Similar Messages

  • Using SET GET parameters in ITS

    Hi All,
    Is it possible to use set get parameters in ITS. We want to set some parameters in a BADI and read the value in ITS Template .
    Or is there any other method to do this?
    Thanks,
    Anubhav

    Sure. In your abap program use the following code
    *  ITS macros
    INCLUDE avwrtcxm.
    GET PARAMETER ID 'YOUR_PARAMETER' FIELD SAVE_PARAMETER.
    field-set u2018~YOUR_PARAMETERu2019 1 SAVE_PARAMETER.
    field-transport.
    in the template you can now use ~YOUR_PARAMETER.
    regards,
    Klaus
    Edited by: Klaus Layer on Feb 3, 2009 5:05 PM

  • Getting parameters from text and file input tag. .  canyou help me ?

    Hello!
    Is there anyway of getting parameters from an
    text field input in a form like :
    <form name="signinForm" method="post" action="uploadFile.jsp" enctype="multipart/form-data" >Actually I would like to insert the parameters and make the upload of an file
    on the same form. It is something likethis :
    Form.jsp
    <form name="signinForm" method="post" action="uploadFile.jsp" enctype="multipart/form-data" >   
    <input type="text" id="name" name="signinName" />
    <input name="signinFile" id="fileUp" type="file" />   
    <input type="submit" id="submit_btn" name="signinSubmit"/>uploadingFile.jsp
    <%@ page import="java.io.*,javax.servlet.http.HttpServletRequest,javax.servlet.ServletInputStream" %>
    <%@ page import="java.io.FileWriter,java.io.IOException" %>
    <%
    .//upload the file
    String email = request.getParameter("signinName").trim(); //this line is bringing me an NullPointerException
    %>Thanks in advance for any suggestion!!
    All the best!

    You cannot use the HttpServletRequest object to retrieve parameters from a multipart form. You'll have to use a package that can parse such a form. I suggest Apache commons FileUpload.
    http://jakarta.apache.org/commons/fileupload/
    Using this package you can get both the file upload and any other parameters.

  • Problem with SET GET parameters

    Hi all,
    I am facing a problem using SET and GET parameters.
    There is a Z transaction(Dialog program) where some fields of screen are having parameter ID's. That transaction is designed to diaplay/change status of only one inspection lot at a time.
    Now I need to call that transaction in a loop using BDC. I mean i need to update the status of multiple inspection lots(one after the other). Before calling the transaction I am using
    SET PARAMETER ID 'QLS' FIELD lv_prueflos.
    Unfortunately the transaction is only changing the first inspection lot. When I debugged I found that the screen field is changing in PAI. Even though in PBO it shows the next value, when it goes to PAI it is automatically changing to the first value(inspection lot).
    Example: Inspection Lots : 4100000234
                                               4100000235
                                              4100000236
    Now first time when the call transaction is being made the status of insp lot 4100000234 is changed. For the second time when insp lot 4100000235 is being passed in PBO ican see this. But the moment it enters PAI the screen field changes to 4100000234.
    Could you pls help me in solving this issue.
    Thanks,
    Aravind

    Hi,
    Problem with SET GET parameters
    Regarding on your query. Follow this below link.
    It will help you.
    Re: Problem with Set parameter ID
    Re: Problem in Set parameter ID
    I Hope it will helps to you.
    Regards,
    Sekhar

  • Report  using Set parameter & get parameters.

    Hi,
           My requirement is from select query  the list of PO will be display. Now i want when i click on one of the purchase order .
    i want to diaplay PO using CALL TRANSACTION 'ME23N'  with the help of set and get parameters .  or can i do it with interactive report.
    Regards,

    Hi,
    1) Write a Report to show the Output(Use HIDE statment for PO filed while outputing the list).
    2) In the event AT LINE-SELECTION write logic.
    GET CURSOR FIELD field VALUE val.
    SET PARAMETER ID 'BES' FIELD dobj.
    CALL TRANSACTION ME23N.
    Regards,
    J.

  • How to use SET & GET Parameters in Module Pool

    Hi Friends,
    Can anyone please tell how to use SET / GET parameters and PARAMETER ID for a text box (Input / Output field ) in module pool? What is the purpose and where do we need to do coding for it?
    Note : I will definitely give the marks for good responses.
    Thanks in advance,
    Pradeep

    Hi Pradeep,
    You can save values in the SAP memory using a parameter ID. These
    are user and terminal-session specific, but available to all internal and
    external sessions.
    SET Parameter copies the corresponding field contents into the SAP
    System memory in the PAI processing block.
    GET Parameter copies the corresponding field contents from the SAP
    memory at the end of the PBO processing block, after data has been
    transferred from the program, if the screen field still has its initial value
    You can link an input/output field to an area of the SAP memory in the
    ABAP Dictionary.
    When you use an input/output field that is defined in the ABAP
    Dictionary, its parameter ID is displayed in the Dictionary attribute
    Parameter ID in the Screen Painter.
    Usage
    SET PARAMETER ID: ’CAR’ FIELD space,
    ’CON’ FIELD space,
    ’DAY’ FIELD space.
    Here is the link that explains the usage of GET/SET in detail
    <a href="http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db9e0435c111d1829f0000e829fbfe/content.htm">http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db9e0435c111d1829f0000e829fbfe/content.htm</a>
    Regards,
    Sharadha

  • How to run a project which gets parameters from a batch file

    Hello all,
    I use to run a program, which gets parameters only by interactive mode, using a batch file as you can see below:
    # myprogram < batchfile.txt
    Now, I'm updating its code by SunStudioExpress IDE and I'd like to run it from the batchfile. I have noticed that the project properties window has the option run -> arguments, however this program doesn't accept arguments this way and for changing it, I'd have a hard job.
    Does someone know how to run this project and to get its parameters from batchfile?
    Regards,
    Glauber

    Ah, it appears that when you run the project, "<" is passed as one of the arguments and is not treated as input redirection.
    Sorry, it looks like it is not possible to do the redirection; and it looks like a bug to me. Could you please file it through bugs.sun.com? It shouldn't take long as the problem is evident now.

  • JSF and GET parameters

    Hi,
    This might be an age old question - but I can't seem to find a nice elegant solution - is there any support in JSF for GET parameters? Are there any plans for this to be included? What can I do in the meantime?

    Use the #{param.name} syntax as the value of a property in your managed-bean declaration in the faces-config. Then load from the database in a @PostConstruct method. Then just reference the managed bean normally in your JSP/view. When the first reference occurs the implementation will instantiate the bean, set the property and invoke the @PostConstruct method.

  • How to use HTTPSERVICE in Actionscript project.

    Hello all,
    I am doing an actionscript project, I want to use httpservice to send a data to server . Is any one knows how to use httpservice in actionscript project?
    thanx

    following code may help:
    import mx.rpc.http.HTTPService;
    import mx.rpc.events.FaultEvent;
    import mx.rpc.events.ResultEvent;
    private function callHTTPSERVIDE():void
    var hs:HTTPService = new HTTPService();
    hs.url = 'Server.php';
    hs.addEventListener( ResultEvent.RESULT, resultHandler );
    hs.addEventListener( FaultEvent.FAULT, faultHandler )
    hs.send();
    private function resultHandler( event:ResultEvent ):void
    //handle your result here
    private function faultHandler( event:FaultEvent ):void
    // code for fault handling.

  • How to access GET-parameters in portal url

    Is it possible to access GET-parameters in a bsp application in an iview in the enterprise portal, and if so, how do I do it?
    If you look at the url of this post (/message/1514719#1514719 [original link is broken])
    I would like to have the value of "forumID" in the bsp application in the iview with shortlink "thread".

    Raja,
    your solution is what I was initially looking for, so thank you.
    Can you also supply a link to the article you refer to?  I can't find it:-)
    But while looking for this I found something even better, a way to pass parameters to an iview without having to define them in the iview ApplicationParameter-property.
    Apparently the trick is to add the parameter "DynamicParameter" to the url, that translates to different parameters in your bsp application(iview).
    So if you want your bsp application to have the parameters "roomid=555&date=01.01.2007" your url should be
    http://bla/irj/portal/rooms?DynamicParameter=roomid%3D555%26date%3d01.01.2007
    where %3D is the ascii representation of "=" and %26 is the ascii representation of &.
    I found this here : /message/529588#529588 [original link is broken] , but in this thread they say to separate the parameters by a ";", whereas for me it only works when i use %26 (&).
    Message was edited by: Dries Horions

  • Easiest way to pass GET parameters to applet - Javascript really required??

    I want to transfer GET parameters to an appelt, i.e. in the call
    http://***/test.html?param1=abc&param2=def
    the param/values should be available in the applet.
    After some searching I've got the impression that this requires Javascript
    (http://stackoverflow.com/questions/12585022/how-to-pass-values-from-html-page-to-java-applet),
    but I would like to avoid this...
    Any help appreciated,
    Dieter

    found something:
    http://docs.oracle.com/javase/tutorial/deployment/applet/invokingAppletMethodsFromJavaScript.html
    http://stackoverflow.com/questions/14016972/call-java-applet-function-from-javascript
    and this is doing the trick, the Applet has Setters for my params
    <html>
    <head>
    <script language="Javascript">
    function readGetParams(){
       x = window.location.search.replace("?","");
       y = x.split("&");
       v1 = y[0].split("=")[1];
       v2 = y[1].split("=")[1];
       //alert( p1 + " -- " + v1 + " -- " + p2 + " -- " + v2);
       document.getElementById("fscapp").setUserID(v1);
       document.getElementById("fscapp").setCourseID(v2);
    </script>
    <title>FS Control Panel</title>
    </head>
    <body onload="readGetParams()">
    <h1>FS Control Panel</h1>
    <applet code="fsc.class" archive="fsc.jar" id="fscapp" width=500 height=500>
    </applet>
    </body>
    </html>

  • How to convert get parameters to post

    hi,
    i have a problem in adding parameters to url
    it is not executing all the parameters as the length is too long
    so i read in help file that if lenght is too long we need to convert get parameters to post
    can any one tell me how to do that its urgent
    http://sapwin2.agi.com:50000/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fcom.sap.pct!2fplatform_add_ons!2fcom.sap.ip.bi!2fiViews!2fcom.sap.ip.bi.bex?TEMPLATE=y_test_w001_q&BI_COMMAND_1-BI_COMMAND_TYPE=SET_ITEM_PARAMETERS&BI_COMMAND_1-VISIBILITY=HIDDEN&BI_COMMAND_1-TARGET_ITEM_REF=ANALYSIS_ITEM_1
    please tell me how to convert to post parameters

    Hi,
    in standard HTML post and get are the two methods sending data from one page to another. While method get the parameter to the URL after "?" and seperated by "&" method post is using an HTML-form.
    In your case I would suggest to implement a form with hidden fields named by your parameters and containing the values. By clicking the submit button, the hidden fields are transmitted as post parameters.
    example
    <html>
    <head> </head>
    <body>
    <form name="test" action="http://sapwin2.agi.com:50000/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fcom.sap.pct!2fplatform_add_ons!2fcom.sap.ip.bi!2fiViews!2fcom.sap.ip.bi.bex">
    <input type="hidden" name="TEMPLATE" value="y_test_w001_q">
    <input type="hidden" name="BI_COMMAND_1-BI_COMMAND_TYPE" value="SET_ITEM_PARAMETERS">
    <input type="hidden" name="BI_COMMAND_1-VISIBILITY" value="HIDDEN">
    <input type="hidden" name="BI_COMMAND_1-TARGET_ITEM_REF" value="ANALYSIS_ITEM_1">
    <input type="submit>
    </form>
    <body>
    </html>
    Hope this helps.
    Regards Michael

  • What is an elegant way to get parameters?

    Is there an elegant way to get parameters?
    I set the id for a parameter on the jsf page and then I can find the parameter by iterating through the parameter map searching the strings until I find the keypair that I need then I grab the value that was submitted on the form.
    For example, I set id=gpaNbr but the string in the parameter map is id0:gpaNbr --- it's got that little "id0:" thingy prepended to the string.
    Can someone suggest a less clumsy technique?
    Thanks,
    Al Malin

    Sorry, forgot to mention it's for JSFs with 10.1.3 dp.

  • Problem !! How to upload an file and get parameters on the same form ?

    Hello!
    Is there anyway of getting parameters from an
    text field input in a form like :
    <form name="signinForm" method="post" action="uploadFile.jsp" enctype="multipart/form-data" >Actually I would like to insert the parameters and make the upload of an file
    on the same form. It is something likethis :
    Form.jsp
    <form name="signinForm" method="post" action="uploadFile.jsp" enctype="multipart/form-data" >   
    <input type="text" id="name" name="signinName" />
    <input name="signinFile" id="fileUp" type="file" />   
    <input type="submit" id="submit_btn" name="signinSubmit"/>uploadingFile.jsp
    <%@ page import="java.io.*,javax.servlet.http.HttpServletRequest,javax.servlet.ServletInputStream" %>
    <%@ page import="java.io.FileWriter,java.io.IOException" %>
    <%
    .//upload the file
    String email = request.getParameter("signinName").trim(); //this line is bringing me an NullPointerException
    %>Thanks in advance for any suggestion!!
    All the best!

    You can get the parameter value directly. You can do the following to get the parameter name.
    Directly take the request's input stream and parse the header and findout the value for text field.
    Or you can use apache's file upload utilities and do the following
    DiskFileItemFactory factory = new DiskFileItemFactory();
                   ServletFileUpload upload = new ServletFileUpload(factory);
                   List fileItems = upload.parseRequest(request);
                   Iterator iter = fileItems.iterator();
                   while (iter.hasNext()) {
                        FileItem item = (FileItem) iter.next();
                        if (item.isFormField()) {
         //Form data fields will be displayed here          out.println(item.getFieldName());
         out.println(item.getString());
    All the best..

  • How to pass GET parameters from BPEL to webservice?

    Hi,
    How can I pass GET parameters to webservice from BPEL. For example if a webservice expects to get 2 parameters as GET parameters like the following URL:
    http://xxx.xxx.xxx.xxx/some-web-service?parama=abc&paramb=123
    How can I pass parama and paramb to the webservice call?
    Thanks,
    Ronen

    Hello Ronen,
    Im assuming that you're using SOA Suite 11g. The developer guide describes the following: http://docs.oracle.com/cd/E29505_01/dev.1111/e10224/sca_bindingcomps.htm#CHDEEGDC
    And the following blogpost explains in detail how to implement https://blogs.oracle.com/reynolds/entry/oracle_http_adapter
    Good luck!
    Melvin

Maybe you are looking for

  • Deleting referenced files in Aperture 3

    With version 3, I'm trying Aperture for the first time and have a deletion question. I've imported both ways: 1) "in the Aperture Library", and 2) "in their current location" My question concerns method 2, aka Referenced Files. Is there an option tha

  • Apple's Infinite Email loop

    I called my ISP provider ,Wed 6/13, morning and they said everything is working properly. I couldn't get my email on either of my macs yesterday or this morning. I got to work and it was working. It just keeps sending me in a loop from login on the S

  • Domain Alias approch - Best Practice Request

    Hello, I am managing a company that has many domains. We have been using standard sendmail for mail server. I have set it up through relay-domains etc... such that a user can get mail at any of the listed domains (there are 76 of them!). So, if I hav

  • Win 7 64bit Can't install driver

    I have the latest software and I have a brand new storm2, when I install the software, all is fine.  When i connect my phone , it doesn't charge and the software does not reconize it In device manager it says "RIM Composite Device"  and says  "The dr

  • Time for new eyeglasses?

    Hi all, I just downloaded and installed Lightroom on my new notebook.  Upon opening LR 4.2 I find all titles (fonts) much too small (I now qualify as a senior citizen and my eyes aren't what they used to be)!   Other than lowering my screen's resolut