Search Results

Search found 52885 results on 2116 pages for 'http redirect'.

Page 45/2116 | < Previous Page | 41 42 43 44 45 46 47 48 49 50 51 52  | Next Page >

  • Spring MVC Controller redirect using URL parameters instead of in response.

    - by predhme
    I am trying to implement RESTful urls in my Spring MVC application. All is well except for handling form submissions. I need to redirect either back to the original form or to a "success" page. @Controller @RequestMapping("/form") public class MyController { @RequestMapping(method = RequestMethod.GET) public String setupForm() { // do my stuff return "myform"; } @RequestMapping(method = RequestMethod.POST) public String processForm(ModelMap model) { // process form data model.addAttribute("notification", "Successfully did it!"); return "redirect:/form"; } } However as I read in the Spring documentation, if you redirect any parameters will be put into the url. And that doesn't work for me. What would be the most graceful way around this?

    Read the article

  • Symfony 1.4: Is it possible to prevent escaping of a redirect URL?

    - by Tom
    Hi, If I do a redirect in action as normal: $this->redirect('@mypage?apple=1&banana=2&orange=3'); ... Symfony produces the correct URL: /something/something?apple=1&banana=2&orange=3 However, the following gets escaped for some bizarre reason: $string = 'apple=1&banana=2&orange=3'; $this->redirect('@mypage?'.$string); ... and the following URL is produced: /something/something?apple=1&amp;banana=2&amp;orange=3 Is there a way to avoid this escaping and have the ampersands appear correctly in the URL? I've tried everything I can think of and it's driving me mad. I need this for a situation where I'm pulling a saved query as a string from the database and would just like to latch it onto the URL. I'm aware that I could generate an array from the string and then generate a brand new URL from the array, but it just seems like a lot of overhead because of this silly escaping. Thanks.

    Read the article

  • Should I call redirect() from within my Controller or Model in an MVC framework?

    - by justinl
    I'm using the MVC PHP framework Codeigniter and I have a straight forward question about where to call redirect() from: Controller or Model? Scenario: A user navigates to www.example.com/item/555. In my Model I search the item database for an item with the ID of 555. If I find the item, I'll return the result to my controller. However, if an item is not found, I want to redirect the user somewhere. Should this call to redirect() come from inside the model or the controller? Why?

    Read the article

  • IIS 6.0 Server Too Busy HTTP 503 Connection_Dropped DefaultAppPool

    - by Shiraz Bhaiji
    We have a site which is running on a windows 2003 cluster with 2 64bit machines. The site needs to be able to cope with over 20,000 concurrent users One of the things that the site does is to allow the download of a 2MB file (which is cached in memory). We have low CPU and memory usage. We also have surplus bandwidth. It appears that we are running out of connections due the time it takes the user to download the file (some users have slow internet connections). In the IIS log we get HTTP 503 errors. In the HTTPErr log we get mainly Connection_Dropped DefaultAppPool with some Timer_EntityBody DefaultAppPool. Question is: How can we configure IIS to allow more connections? Or is there something that I am missing here? Thanks Shiraz

    Read the article

  • Apache Solr: Setting HTTP Response Headers From solrconfig.xml For CORS

    - by Noah Freitas
    Is it possible to setup the sending of a custom HTTP response header from within the solrconfig.xml file? I am thinking that it might be possible to add some configuration to the <requestDispatcher> since it controls caching headers. I am sure this is possible in the servlet container configuration (Jetty, Tomcat, etc.), but I would like to do this from within Solr's configuration files if at all possible. If this makes any difference, I am attempting to set an Access-Control-Allow-Origin header for CORS AJAX requests for a different host.

    Read the article

  • How to post a file via HTTP post in vb.net

    - by Worz
    Hi all! Having a problem with sending a file via HTTP post in vb.net. I am trying to mimic the following HTML so the vb.net does the same thing. <form enctype="multipart/form-data" method="post" action="/cgi-bin/upload.cgi"> File to Upload: <input type="file" name="filename"/> <input type="submit" value="Upload" name="Submit"/> </form> Hope someone can help!

    Read the article

  • HTTP 404 Error manifests itself as EndPointNotFoundException on a WCF client

    - by dudia
    How can I make my client treat 404 Error correctly? Right now it catches a general exception... My WCF Server uses WebOperationContext.Current.OutgoingResponse.SetStatusAsNotFound(); To return a 404 Error code however my WCF client interperts it as an EndPointNotFoundException There was no endpoint listening at http://myUrl that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. The inner exception is WebException "The remote server returned an error: (404) Not Found.

    Read the article

  • Upload file via HTTP from VBA (WinHTTP)

    - by chiccodoro
    Hi all, I'm trying to HTTP upload a binary file programmatically from within VBA. I intend to put an ASPX page on the server. I know there are lots of nice ways to do that (e.g. use web service instead of aspx), but my constraint is that it must run in VBA (in an excel file), and that I cannot install any additional components on the client. So I guess I'll use WinHTTP, and I've found several examples to post form data, but not to post a binary file. I probably need to base64 the file contents? If so, please let me know. If I can make WinHTTP do file encoding for me, please let me know. If there is a much better way to reach my goal (Upload file from within VBA, server needn't necessarily be ASPX, could be a ASP.NET-Web service as well), please let me know... Thx, chiccodoro

    Read the article

  • monitor http request from non-browser

    - by Ananth
    hi, I want to monitor http request generated out of a exe. Is there any tool that can help me? Actually, an exe would call my asp.net web page to register a user. The exe constructs the POST data request and calls my page. when the request reaches my web page, I don't see any data. I want to monitor the Request object and the traffic to find the reality. Any help is appreciated. Thanks. ~/Ananth

    Read the article

  • Using .htaccess to force either HTTP or HTTPS

    - by ILMV
    I have already got this code to force these URLs to HTTPS: RewriteCond %{HTTPS} off RewriteCond %{REQUEST_URI} ^/my/?.*$ RewriteCond %{REQUEST_URI} !^/my/basket/add/$ RewriteCond %{REQUEST_URI} ^/login/?.*$ RewriteCond %{REQUEST_URI} ^/logout/?.*$ RewriteCond %{REQUEST_URI} ^/register/?.*$ RewriteCond %{REQUEST_URI} ^/newsletter/?.*$ RewriteCond %{REQUEST_URI} ^/reset-password/?.*$ RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] And this works really well, but what I want to do is force any URL that does not comply with the above conditions to HTTP. Any thoughts on how I could do this? It has to be done using .htaccess, I have been achieving it by using our PHP framework, but this has been messing our Google crawl. Cheers!

    Read the article

  • Struts and logging HTTP POST request body

    - by Ivan Vrtaric
    I'm trying to log the raw body of HTTP POST requests in our application based on Struts, running on Tomcat 6. I've found one previous post on SO that was somewhat helpful, but the accepted solution doesn't work properly in my case. The problem is, I want to log the POST body only in certain cases, and let Struts parse the parameters from the body after logging. Currently, in the Filter I wrote I can read and log the body from the HttpServletRequestWrapper object, but after that Struts can't find any parameters to parse, so the DispatchAction call (which depends on one of the parameters from the request) fails. I did some digging through Struts and Tomcat source code, and found that it doesn't matter if I store the POST body into a byte array, and expose a Stream and a Reader based on that array; when the parameters need to get parsed, Tomcat's Request object accesses its internal InputStream, which has already been read by that time. Does anyone have an idea how to implement this kind of logging correctly?

    Read the article

  • Ruby Net::HTTP - Read only x number of bytes of the body

    - by bvanderw
    It seems like the methods of Ruby's Net::HTTP are all or nothing when it comes to reading the body of a web page. How can I read, say, the just the first 100 bytes of the body? I am trying to read from a content server that returns a short error message in the body of the response if the file requested isn't available. I need to read enough of the body to determine whether the file is there. The files are huge, so I don't want to get the whole body just to check if the file is available.

    Read the article

  • HTTP Cache Control max-age, must-revalidate

    - by nyb
    I have a couple of queries related to Cache-Control. If I specify Cache-Control "max-age=3600, must-revalidate" for a static html/js/images/css file, with Last Modified Header defined in HTTP header, a. Does browser/proxy cache(liek Squid/Akamai) go all the way to orgin server to validate before max-age expires? Or will it serve content from cache till max-age expires? b. After max-age expiry(that is expiry from cache), is there a IMS check or is content re-downloaded from origin server w/o IMS check?

    Read the article

  • from http to https

    - by Chez
    I have got a simple web app. A web page with a form to submit. A servlet on the serverside. It works. I am now asked to change it so that the address of the form changes from http://www.example.com/myForm.html to https://www.example.com/myForm.html What are the steps to do this ? do I have to change my servlet ? my deployment ? my web page ? all of them ? Thanks

    Read the article

  • Zend Framework REST service HTTP status code problem

    - by Baversjo
    I'm trying to create a REST service in zend framework. I'm using zend server. Here's my code: class ArticleController extends Zend_Rest_Controller { public function postAction() { //Create the acticle and return it $data = array("foo" => 0, "boo" => 11); $this->getResponse()->setHttpResponseCode(201); $this->_helper->json($data); } The HTTP response returns the appropriate headers and JSON data but under the JSON data there's an apache error document. The only way I can think of to remove the appended error document is to add the following in my httpd.conf file: ErrorDocument 201 " " But what's the "corrent" way of doing this?

    Read the article

  • Send HTTP Post with default browser with C#

    - by Paul
    Hello, I am wondering if it is possible to send POST data with the default browser of a computer in C#. Here is the situation. My client would like the ability to have their C# application open their browser and send client information to a webform. This webform would be behind a login screen. The assumption from the application side is that once the client data is sent to the login screen, the login screen would pass that information onto the webform to prepopulate it. This would be done over HTTPS and the client would like this to be done with a POST and not a GET as client information would be sent as plain text. I have found some wonderful solutions that do POSTS and handle the requests. As an example http://geekswithblogs.net/rakker/archive/2006/04/21/76044.aspx So the TL;DR version of this would be 1) Open Browser 2) Open some URL with POST data Thanks for your help, Paul

    Read the article

  • Emulating HTTP POST via httpclient 3.x for multi options

    - by Frankie Ribery
    I want to emulate a HTTP POST using application/x-www-form-urlencoded encoding to send a option group that allows multiple selections. <select name="groups" multiple="multiple" size="4"> <option value="2">Administration</option> <option value="1">General</option> </select> Does adding 2 NameValuePairs (NVP) with the same name work ? My serverside log shows that only the first NVP was received. e.g PostMethod method = ...; NameValuePair[] nvpairs = { new NameValuePair( "groups", "2" ); new NameValuePair( "groups", "1" ); }; method.addParameter( nvpairs ); Only the groups=1 parameter was received. Thanks

    Read the article

  • Parse http GET and POST parameters from BaseHTTPHandler?

    - by ataylor
    BaseHTTPHandler from the BaseHTTPServer module doesn't seem to provide any convenient way to access http request parameters. What is the best way to parse the GET parameters from the path, and the POST parameters from the request body? Right now, I'm using this for GET: def do_GET(self): parsed_path = urlparse.urlparse(self.path) try: params = dict([p.split('=') for p in parsed_path[4].split('&')]) except: params = {} This works for most cases, but I'd like something more robust that handles encodings and cases like empty parameters properly. Ideally, I'd like something small and standalone, rather than a full web framework.

    Read the article

  • Using HTTP Vary header to decide on a strategy to process a request

    - by Jacques René Mesrine
    I have a specific REST endpoint that creates a topic in a forum; but I want to apply different strategies when processing the request. e.g. If client A makes the call, perform moderation. if client B makes the call, do something else. The easiest would be to add a query param for differentiation: POST /resource?from=xyz Another brilliant idea is to use the Vary HTTP header. POST /resource Vary: xyz Any problems with this approach ?

    Read the article

  • Separation of logic from presentation: HTTP variable names?

    - by Allan Jardine
    Hello all, This could probably be considered an academic question, rather than a real world one - but throwing it out to see if anyone has any great ideas! We all know that keeping the business logic of an application separate from the presentation is a good idea (I'm looking at web-apps atm), but there needs to be an understanding between the business logic for what HTTP variables to expect (and then process) and the variable names which are sent by the presentation layer. Is this simply a matter of telling the designer what variable names to use in a template? The template doesn't need to know what the variable names are (unless using them for JS/CSS selectors), so why should they be 'hardcoded' in there. Or should the business logic put the names into variables to be printed out? Another layer of complexity for the templates? Does anyone have any experience of this, or thoughts on how to deal with it? Thanks, Allan

    Read the article

  • C++ library for dealing with multiple HTTP connections

    - by JWood
    Hi, I'm looking for a library to deal with multiple simultaneous HTTP connections (pref. on a single thread) to use in C++ in Windows so it can be Win32 API based. So far, I have tried cURL (multi interface) which seems to be the most appropriate that I have found but my problem is that I may have a queue of 200 requests but I need to only run 4 of them at a time. This becomes problematic when one request may take 2 seconds and another may take 2 mins as you have to wait on all handles and receive the result of all requests in one block. If anyone knows a way round this it would be very useful. I have also tried rolling my own using WinHTTP but I need to throttle the requests so they would ideally need to be on a single thread and use callbacks for data which WinHTTP does not do. The best thing I've found which would solve all my problems is ASIHTTPRequest but unfortunately it's Mac OSX only. Thanks, J

    Read the article

  • Wrangling Control of HTTP Headers in ASP.NET

    - by Andrew Burgess
    I'm working with ASP.NET MVC3, and I'm trying to get absolute control over my headers because a client application that I'm working with expects a very specific content type. What I'm finding when using Fiddler to examine the HTTP traffic is that the text encoding is being returned as part of the header. For example, the client is expecting application/appname in the Content-Type header, but the server is returning application/appname; charset=utf-8. I think the client is using a strict comparison for checking the type, so I want to be able to specify exactly what is emitted in the headers. Right now I have a custom ActionResult in which I clear the headers and then specify only the content type, but the encoding still seems to be added on. How can I remove the encoding from the Content-Type header?

    Read the article

  • App Engine HTTP 500s

    - by pocoa
    This request caused a new process to be started for your application, and thus caused your application code to be loaded for the first time. This request may thus take longer and use more CPU than a typical request for your application. I've handled all the situations, also DeadlineExceededError too. But sometimes I see these error messages in error logs. That request took about 10k ms, so it's not exceeded the limit too. But there is no other specific message about this error. All I know is that it returned HTTP 500. Is there anyone know the reason of these error messages? Thank you.

    Read the article

  • http response to GET request - working in FF not Chromium

    - by Tyler
    For fun I'm trying to write a very simple server in C. When I send this response to Firefox it prints out the body "hello, world" but with Chromium it gives me a Error 100 (net::ERR_CONNECTION_CLOSED): Unknown error. This, I believe, is the relevant code: char *response = "HTTP/1.0 200 OK\r\nVary: Accept-Encoding, Accept-Language\r\nConnection: Close\r\nContent-Type: text/plain\r\nContent-Length:20\r\n\r\nhello, world"; if(send(new_fd, response, strlen(response), 0) == strlen(response)) { printf("sent\n"); }; close(new_fd); What am I missing? Thanks!

    Read the article

  • How to read the response stream before the Http response completes

    - by Marwan Aouida
    When making a request using HttpWebRequest object, I need to call the method GetResponse() to send the request and get the response back. The problem with this method is that it doesn't return the response object until all data has been received. Say I am downloading a 100 MB file, I won't be able to read it until the response finish and all the 100 MB is downloaded. What I want is to be able to read the response stream bytes as soon as they arrive, without waiting for the response to complete. I know I can use the Range Http header, but it won't work on my situation.

    Read the article

< Previous Page | 41 42 43 44 45 46 47 48 49 50 51 52  | Next Page >