Http Request - error in URL when params contain spaces

Hi friends , I invoke a servlet from a HTTP client using the GET method. I pass two Strings which contain spaces and non-english alphabets.
I get malformed URL when I invoke the servlet with these parameters in the URL.
Can someone please help and tell me how to pass spaces and special characters in the URL. Do I need to use some escape characters?
TIA
Harish

You can encode the strings prior to passing them to the servlet as follows:
String parm1="http://www.mySite.com/this includes spacees/test.htm";
String param2=" what ever in non-english alphabets";
parm1=URLEncoder.encode(parm1);
parm2=URLEncoder.encode(parm2);
;o)
V.V.
PS: Sorry click the Post! button too soon before the sample code was completed!

Similar Messages

  • HTTP Request Error

    Hi Iam using Flex to display pie chart in my application. Im
    getting the pie chart in Mozilla firefox but in IE iam getting Http
    Request Error. Iam giving the code what i wrote. Please find. can
    anybody help me in this? thanks
    mxml file
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" width="300" height="232" backgroundColor="white"
    usePreloader="true">
    <mx:Script>
    <![CDATA[
    import mx.messaging.channels.StreamingAMFChannel;
    import mx.charts.series.LineSeries;
    import mx.rpc.events.ResultEvent;
    import mx.rpc.events.FaultEvent;
    import mx.controls.Alert;
    import mx.controls.*;
    import mx.events.*;
    [Bindable]
    public var orXmlList:XMLList;
    [Bindable]
    public var orXml:XML;
    [Bindable]
    public var orderCount:String = "0";
    private function getOrXML():void{
    orRPC.cancel();
    orRPC.send();
    public function handleXML(event:ResultEvent):void
    orXml = event.result as XML;
    orXmlList = event.result.orderResultsData.order as XMLList;
    var orMetaString:String = "orMeta";
    orderCount = orXml.orderResultsData[0].orMeta[0].orderCount;
    public function handleFault(event:FaultEvent):void
    Alert.show(event.fault.faultString, "Error");
    ]]>
    </mx:Script>
    <mx:HTTPService result="handleXML(event);"
    fault="handleFault(event);" id="orRPC" resultFormat="e4x"
    method="POST" url="/global/corpOrderResults.csc"
    useProxy="true">
    </mx:HTTPService>
    <mx:PieChart x="0" y="46.95" id="orPieChart" width="168"
    height="126" dataProvider="{orXmlList}"
    creationComplete="getOrXML();" showDataTips="true">
    <mx:series>
    <mx:PieSeries nameField="name" field="count" />
    </mx:series>
    </mx:PieChart>
    <mx:Legend dataProvider="{orPieChart}" x="141.25"
    y="56.6" verticalGap="0"/>
    <mx:Label id="orInfoLabel" x="0" y="20.95" text="Orders
    updated in the last 30 days: {orderCount}" width="283.4"
    height="18"/>
    </mx:Application>
    Text
    And my JSp page is:
    <div id="flashcontent">
    </div>
    <script type="text/javascript">
    var so = new SWFObject("/global/flash/litigationByNoc.swf",
    "mymovie", "400", "200", "8", "#336699");
    so.write("flashcontent");
    </script>

    Hi,
    I have checked the logs. I am getting errors like the below:
    1.     com.sap.engine.services.servlets_jsp.server.deploy.impl.exceptions.WCEApplicationNotStartedException: The application [sap.com/com.sap.portal.ivs.iviewservice] is configured to have ALWAYS start up mode. Currently it is in STOPPED status - because of this it will not be started implicitly by the Web Container service and any internal operation that needed this application to be running will fail. There are two possible reasons for STOPPED status: 1) The application failed to start during cluster startup. 2) The application is stopped by system administrator.
    2.     .info.exception.WD4VCRuntimeException: FAILED: process plan id: generatedBindPlan_CWG_UI action: null
    3.     Thread HTTP Worker [2] failed to acquire exclusive lock on client session
    But the data is being processed by the code correctly. I tried printing the final values of the o/p and the values are as expected.

  • RPC Fault faultString="HTTP request error"

    Hi I built a project from an existing fxp file.. But when I try to run it I receive tthis error.. What is wrong??
    [RPC Fault faultString="HTTP request error" faultCode="Server.Error.Request" faultDetail="Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032:
    I am sure that the fxp file is correct as I tested it to another computer.....
    Please it is urgent!!
    the whole error is this
    [RPC Fault faultString="HTTP request error" faultCode="Server.Error.Request" faultDetail="Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: http://localhost:8888/*/Applications/MAMP/htdocs/*/php/get_course.php"]. URL: http://localhost:8888/*/Applications/MAMP/htdocs/V3_tutor_for_CODE_2/php/get_course.php"]
              at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()[C:\autobuild\3.x\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:290]
              at mx.rpc::Responder/fault()[C:\autobuild\3.x\frameworks\projects\rpc\src\mx\rpc\Responder.a s:58]
              at mx.rpc::AsyncRequest/fault()[C:\autobuild\3.x\frameworks\projects\rpc\src\mx\rpc\AsyncReq uest.as:103]
              at DirectHTTPMessageResponder/errorHandler()[C:\autobuild\3.x\frameworks\projects\rpc\src\mx \messaging\channels\DirectHTTPChannel.as:368]
              at flash.events::EventDispatcher/dispatchEventFunction()
              at flash.events::EventDispatcher/dispatchEvent()
              at flash.net::URLLoader/onComplete()

    Maybe the URL you are accessing is not available from that computer.

  • Error Packaging Media!! HTTP request error

    Hi,
    I have followed all the steps given in FAXs_2_0_Quickstart.pdf.
    In Flash Access Manager, I have selected Single file from the local machine with ad-policy.pol,
    when I click Package Media, I am getting the following error message
    FAULT!
    Error Packaging Media!! HTTP request error
    Tomcat log file is showing following error
    org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet UICommunicator threw exception
    java.lang.NumberFormatException: For input string: ""
        at java.lang.NumberFormatException.forInputString(Unknown Source)
        at java.lang.Integer.parseInt(Unknown Source)
        at java.lang.Integer.valueOf(Unknown Source)
        at java.lang.Integer.decode(Unknown Source)
        at com.adobe.flashaccess.refimpl.util.ParamsReader.readPackagerParams(ParamsReader.java:812)
        at com.adobe.flashaccess.refimpl.userinterface.UICommunicator.packageSingleMediaFile(UICommu nicator.java:1438)
        at com.adobe.flashaccess.refimpl.userinterface.UICommunicator.doPost(UICommunicator.java:129 )
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.ja va:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Unknown Source)
    Thanks for the help.

    Hi Eric,
    Pls find below snapshots of the Preferences, Package Media Tabs and error messages.  Other Tabs have been untouched.
    Thanks.

  • Actionscript error: HTTP request error

    Why do I get this kind of actionscript error? Everytime my page loads up this error immediately shows up:
    [RPC Fault faultString="HTTP request error" faultCode="Server.Error.Request" faultDetail="Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: http://localhost/trytryjfsjfs-debug/total.php" errorID=2032]. URL: http://localhost/trytryjfsjfs-debug/total.php"]
        at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()[C:\autobuild\3.2.0\frameworks\p rojects\rpc\src\mx\rpc\AbstractInvoker.as:220]
        at mx.rpc::Responder/fault()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\Responder .as:53]
        at mx.rpc::AsyncRequest/fault()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\AsyncR equest.as:103]
        at DirectHTTPMessageResponder/errorHandler()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\ mx\messaging\channels\DirectHTTPChannel.as:362]
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at flash.net::URLLoader/onComplete()
    I checked the said URL and this is my code of total.php:
    <?php
    $projName = mysql_real_escape_string($_POST["projNameTI"]);
    $query = "SELECT itemno, divno,descs,qty,unit,unitcost,qty*unitcost as subtotal, SUM(qty*unitcost) as total,psid,project_id FROM projectspecs
    Where project_id = (SELECT project_id FROM project where name='$projName')";
    $result = mysql_query($query) or die ("Query failed: ".mysql_error() ."Actual query: ". $query);
    ?>
    It seems that this code works perfectly
    Can someone please help me about this problem, just an explanation how to get this well.
    Hoping for a response.

    http://localhost/trytryjfsjfs-debug/total.php?projNameTI=3       (what ever you have as the id in the db.)
    try to use this URL in your browser and see what you are getting.

  • "http request error" - SQL call sometimes works, sometimes doesn't

    Hello everyone,
    A bit of a random question, maybe someone has an idea...
    I have a flex app that queries data from a mySQL service via http service. Overall, things work great! The queries are quick to return a result and without issues. But, when I view the website from my work PC, I get this error "HTTP Request Error", and none of the SQL calls work. Any ideas? I know my work has very tight security regulations, but I would still think it would be able to work.
    I can't get a better security message because I can't set up and run flex to debug the issue, all I get is "HTTP Request Error", so who knows what it could be. I have tested my website from about 15 computers/different networks, and they all work, except my work PC. Any ideas?
    And yes, the flash version is current.
    Thanks!

    it sounds like the work security is blocking it
    can you write a simple html page that fetches the data and displays it?It might give you a better idea what is happening behind flex

  • Http request error in lvs report viewe

    i have installed license validate service , client and report viewer. when i go to view any report it gives error "HTTP request error"

    Check this first: Re: LVS Viewer: Cannot display the report
    Thanks,
    Gordon

  • LVS Viewer: http request error

    Dear All,
    I installed SAP LVS (server) on DB server and then on terminal server (client and viewer)
    We have SAP8.8 PL08 and SQL2005.
    I got error message http request error when I click the button "query"
    I coped the baseaddress from the server correctly.
    Our IT person said firewall port 30005 has been opened.
    Is there any where I should check as well? Thanks.
    Regards,
    Yuka

    try to do a netstat in order to see if the  lvs is listening in that port,
    beside I want to ask if you started the LVS service, because when u just installed this service is not running until you do it manually ... let us know ...
    regards.

  • LVS HTTP request error

    Hi Experts,
    I'm getting error when trying to run a report. I already configure it correctly but I'm still getting an HTTP request error.  I read few post relating to the problem but none has resolved the issue.
    Another issue is that after installing LVS the server rebooted several times.
    Any feedback will be greatly appreciated.
    Thanks,
    Cyrous

    Hi Cyrous,
    Did you finally solved the problem?
    Have you installed the latest version of the tool available in SDN?
    Please test the latest version and let us know if you have any problem.
    Sorry for the delay in my answer.
    Regards,
    Trinidad.

  • HTTP Request error: 403 Client Error: Forbidden

    Greetings -
    I am trying to pull event data from blobs & tables storage using REST API built using python.
    After running script, I am getting following error -
    HTTP Request error: 403 Client Error: Forbidden
    Could someone please advise me how to fix this.
    Thank you

    Hi Satish,
    Would you be able to share some details about the error like the operation text?
    You could refer the following link for details on the types of 403 errors and why they might occur:
    http://azure.microsoft.com/en-in/documentation/articles/storage-monitoring-diagnosing-troubleshooting/#the-client-is-receiving-403-messages
    Regards,
    Malar.

  • DPS Analytics : HTTP request error

    Dear All,
    I recieve an error message every timeI try to check the analytics for any of our apps: "Error retrieving report from Omniture server: HTTP request error".
    A few weeks ago, an app totally empty statistics - everything zero - which I knew was not true. Today, I get the error, but there is some data on each page - but how do I know this data is correct?
    Anyone that has experience with this? It has been like this the last couple of weeks, but has hoped it was a temporary error. Now, the clients want some statistics on their publications ...
    Thank you in advance,
    Axel Garcia Henriksson

    I do have the same issue. I have to change the dates to get anything, but I don't know if it's reliable.

  • HTTP request error under HTTPS

    Under the HTTPS, we encountered an issue that the content responed by WebSpwhere would display a http request error in flash, but if the content was compressed the flash works fine, may i know if it is necessory to compress everthing response to flash player under https?
    More Detail:
    The applicate side has a header setting for the response as below:
         response.setContentType("text");
         response.setHeader("Cache-Control", "no-cache, must-revalidate");
    The flash would have http request error with below setting in the WebSpwhere's IHS
        AddOutputFilterByType DEFLATE text/html
        AddOutputFilterByType DEFLATE text/plain text/xml
    But if we change it like below it would works fine.
        AddOutputFilterByType DEFLATE text
        AddOutputFilterByType DEFLATE text/html
        AddOutputFilterByType DEFLATE text/plain text/xml

    I always found it odd Flash didn't just use text/plain but to answer you, no you do not need to gzip before sending over HTTPS. Unless it interferes with other things, since you're already compressing text, maybe it's just a good idea to compress it.

  • Http request error on safari

    http request error on safari what is the solution?

    Please post a screenshot that shows what you mean. Be careful not to include any private information.
    Start a reply to this message. Click the camera icon in the toolbar of the editing window and select the image file to upload it. You can also include text in the reply.

  • Pl/sql call to a WS: HTTP request error

    Hello,
    I am trying to call a web service from a pl/sql package and am getting this error from the Apps (10g database)
    ORACLE error 29273 in FDPSTP
    Cause: FDPSTP failed due to ORA-29273: HTTP request failed
    ORA-06512: at "SYS.UTL_HTTP", line 1029
    ORA-28862: SSL connection failed
    ORA-06512: at "APPS.CM_TEST_WS_INVOKE", line 19
    ORA-06512: at line 1
    Could anyone help me resolve this so that I can call the web service?
    Any help would be greatly appreciated.
    -CC
    Edited by: user11121346 on May 1, 2012 10:17 AM

    Hi,
    As this is a SSL call, you need to configure the wallet. Basically if it is a One-way SSL (only webservice server gets authenticated), you need to follow the following steps.
    1.) Extract the Public Certificate of the Target Web service from using the browser
    2.) Import this certificate in the Oracle Wallet using Oracle Wallet Manager
    3.) The schema user trying to invoke the service should have proper ACL permissions
    4.) Test your connection from the R12 SQL directly using below SQL statement. If below is success you can wrap the service call in a package.
    select utl_http.request('https://<service URL>',
    NULL,                     --Proxy Settings if any
    'file:<Wallet_Location>', -- on R12
    <Wallet_Password>
    from dual;Let me know if you still face any issues.
    Regards,
    Neeraj Sehgal

  • "Error opening URL" when loading JPG to MC

    Hi my name is Dana ,I have this problem with my website that
    I can't seem to solve...I will appreciate any help...thanks :)
    Basicall my site is a gallary to display JPG's
    There is a menu to select the topic and then all the relevant
    JPGs are displayed.
    I'm loading the names of the JPGs from an XML I created.
    Then I duplicate a simple mc that I created called holder_mc
    I have 4 col X 3 rows = total 12 holder_mcS in one page.
    So far so good...but the problem begins when I you go back to
    the main menu and try to upload a new set of JPGs.
    Then an error appears and nothing is displayed:
    http://www.whatever..../reception/0649.JPG"
    Error opening URL
    I tried to remove the movie clips using -
    removeMovieClip(_root["holder_mc"+i])
    but I get the same problem.
    Is someone familiar with this problem?
    If

    The URL was just the massege i was getting...nothing more.
    I found the problem...
    I didn't pop the Array that got the images names from the
    XML...so it was trying to load the wrong JPGs...
    thanks for your help :)
    I have one more question regarding to using mcS as buttons,
    it seems that I have to use it with "onEnterFrame" , otherwise it
    doesn't respond. But then I get an error messege ...*** Security
    Sandbox Violation *** ... ' tried to access incompatible context
    Do you know what is the problem? See my attached code.
    Thanks again

Maybe you are looking for

  • I have 5GBs of free space. Itunes saying not enough space to sink. Help?

    My IPhone says I have 5GBs of free space. When I try and sync my music a message pops up saying I need 2.24 more GBs and that my phone won't hold all of my selections. I have already deleted 1000 songs that I had on there from my previous sync and it

  • ? about image resolution/color correction when apple prints photo book

    My first time making a photo book. I color correct and sharpen all of my images in Adobe Lightroom 2 first. Then I save the jpegs and import into iPhoto to make a book. Is there an option for turning off auto color correction when the file is uploade

  • Can't connect to Internet after update

    I've had this issue before but I was atleast able to get on iTunes & firefox. After this update my comp can't connect to the Internet period. I called my cable company & everything was working fine on their end. My modem communicates that it's linked

  • Transfer iCloud data from 4 to 4S

    I'm having trouble with my iCloud data transfer.  I'm trying to send info from my iPhone 4 to my 4S.  Can you make a comprehensible step-by-step set of instructions on how to transfer data from a previous generation to a newer one?

  • RFC as sender

    hi i am trying to do RFC to JDBC scenario My question is when I execute the RFC in SE37 transaction code, how does my output of the function module goes to SAP XI to so that the data goes to JDBC. Please explain me how to execute the function modue i