Error with GET request URL, is it a URL issue or the returned info? - get

I'm trying to retrieve some stuff from a server (can't really go into much detail), but I've run into an issue which is solved by commenting out some stuff in a string being used as the place to hit.
The situation is as follows:
The URL I want to hit is
http://example.com/api/statistics/installations?version=1.0&type=prod
I get errors with this (based on the stuff being returned not being as expected), however using this works:
http://example.com/api/statistics/installations
Just without the refining flags of version and type.
Now, I'm new to working alongside servers, so I was wondering if perhaps the first URL is malformed towards the end or something?
Thanks to anyone who answers, even if it's just clarification the URL is correct at least I know where the problem lies afterward.

The URL is fine in that format, the issue was on the other end.

Related

Magento checkout page redirect to cart page

I am suffering a serious problems. The problem is that when i enter billing information, select shipping method and press continue button then it goes to cart page. But Cart is not empty. It should go to payment method step. I am used magento 1.8.1.0 version. When i click on continue buttom my ajax is running . I get the following error in console
"NetworkError: 500 Internal Server Error - http://www.themeatboutique.com.au/shop/checkout/onepage/saveShippingMethod/"
All things are working fine before 4-5 days.
Finally I found about the problem. The problem is that $this is not working in setTemplate file. Not Sure why it is not working
So Can anyone please tell me the solution
In my experience, the most common cause of 500 Internal Server Error on a Magento page that was previously working is a minor typographical mistake that affects syntax enough to make the .php impossible to compile into op-code, therefore, impossible to render, therefore, impossible to serve to the browser.
On the checkout page, such an issue in any of the code that is collated into the standard onepage "pseudo-view" you're using could produce that result at that step. It sounds like all rendered well up to the step following shipping, so your syntax error is most likely in one or the other of those files that creates the view for those two steps, and is most likely in the one following the shipping method.
Look for the usual suspects, a single-quote / double-quote mismatch, a stray line of code missing a semi-colon, a nested array with mismatched parentheses, etc.
If it is none of these, check your /var/system.log and /var/exception.log files for clues.
It is almost always frustratingly simple when you find it.
Happy hunting!

How to handle urls in load runner?

I have created/recorded a script in Vugen, however the the URL of the site has been changed recently. Is there any way just by replacing the url with a parameter works?
I have tried by replacing url with parameters, the new URL is
http://xsx.xxx.xsx.xxx/test99
Yhe parameters I have tried are below:
NewUrl: http://xsx.xxx.xsx.xxx/
Newhos: test99
I have replaced all in the script and when I run it I get the following error:
Error -27651: Attempted read from an unconnected socket (empty response, no HTTP headers received). URL="http://xsx.xxx.xsx.xxx/scripts/uiServer.dll"
What is the solution for this? Should i record again with the new URL ?
Thanks.
Hope I've understood what you're asking for, so here goes. If it's only the URL that has changed and not the content of the site which you might require later on in your script that this is fairly simple to do.
As you have created the new parameters ensure that they are getting the data from the same DAT file. I.e. newurl.dat which contains the following:
newurl,newhost
http://xsx.xxx.xsx.xxx/,test99
and assign the parameters to the correct column and have the newhost set to sameline as newurl. This way it’s easier to maintain I believe.
Now that the parameters have been created and properly assigned in your script you’ll need to change the url your trying to change from:
http://xsx.xxx.xsx.xxx/oldtest to {newurl}{newhost}
this needs to be done for all instances where the change has occurred.
Hope this helps with your problem you’re having.
Are you certain that the build level has not also changed at the same time as the host? If so then your new instance may be out of synch with the request model of the scripts built using an earlier build. Developers have a habit of including items below the scenes that do affect the site visually but change the structure of the requests. The error you are receiving is common when you attempt to continue a conversation on a dead connection resulting from a missed dynamic session component which may have been added in the last build.
When in doubt quickly record the second site and take a look at the differences in the requests, even to the point of using WinDiff (included in LoadRunner) for this purpose.

Passing an urlencoded URL as parameter to a controller / action at CakePHP

I'm fairly new on CakePHP and because of so, there are some basic things that I used to do with Zend Framework that I'm beaten up with Cake.
I'm working on a project where I have to pass a named parameter to a controller / action. Setting up the route and passing the parameter is fairly simple, my problem is when the parameter is a urlencoded url.
For example: http://www.cakephp.com/controller/action/http%3A%2F%2Fwww.google.com regardless of the controller and action setup, will throw a 404, but passing /controller/action/http://www.google.com work in some way, the only problem is that it identifies the http as a named parameter. In another way, if I do /controller/action?url=http://www.google.com it will work.
The work around that I had used for this is to pass the value as a base64 encoded string, but it brings some limitations. For instance, if it is an API, there is no way that you can guarantee that the system using the API can encode base64 a string.
Anyway the best solution would be still passing a url encoded string to a named parameter. Question is, why CakePHP does not accept a urlencoded string as a parameter and why does it throws a 404?
Thanks all in advance.
I have added a work around this issue. The previous answer that pointed to a post actually answered why it was happening and one of the solutions. What happens is that the workaround for .htaccess on Apache is a bit dangerous because it will disable a security criteria.
There are 2 ways to work this out via code (and I'm using both):
Send all urls as base64 encoded strings
Accept the urls as named params, but, as you will notice, it converts any http:// to http:/, so is necessary to correctly identify when this happens and only then correct the string.
It is far from being a beautiful solution, but it is definitely a practical one.
I stumbled upon this same problem in Cakephp 4.x
Apparantly you can create a custom route with ** that will disable the default urldecoding. Fixing the problem.
So right now I throw a base64_encode(Security::encrypt($val)) value into the Router::url() function. This will url_encode the params by default so it becomes a valid/working url.
Cakephp then urldecodes by default, which is good. But it does it twice? Causing it to split up the params if there is a / present. Which isn't good.
So in my routes.php I added:
$builder->connect('/orders/callback/**', ['controller' => 'orders', 'action' => 'callback']);
Kinda annoying how this works, but it works now. Works like a charm in 4.x and cost me the entire afternoon. Just leaving this here in case anyone else has this problem. (and for future me).
Source: https://github.com/cakephp/cakephp/issues/4723#issuecomment-56912905

IE secure and unsecure items issue

I'm trying to get rid of the error pop-up window that appears in IE saying "page contains both secure and non-secure items". I have made sure all the links are pointing to https:// rather than http://. I have also looked at the fiddler and firebug logs to see that all the requests are being made to https:// links only.
Here's a similar question asked on SO : IE - "This page contains both secure and non-secure items"
The guy whose answer was accepted hit right on target. I wish I knew how he debugged to narrow down to that solution.
Any help is appreciated.
Thanks
You don't need to actually load a resource in order to trigger the warning, a reference is all it takes. The <object> used to load a Flash applet is enough (if you reference the HTTP URI for the Flash Plugin).
The easiest thing to do is to open up the source and search for 'http:' with your editor. If that doesn't turn up anything, do the same with the output of document.getElementsByTagName('html')[[0].innerHTML.
You could either do a top-down or bottom-up approach to try to track down the issue. Top-down is where you'd start commenting out stuff until it goes away while in the bottom-up case you strip out everything and then slowly start adding back in things like Flash, Javascript, and CSS as it may be some include or function that is the culprit.

HttpContext.Current.Request.Url.Host returns a string of numbers

I have a website that emails a link to the invoice when an order is complete.
The link should be http://mysite.com/QuoteAndBook/Confirmation?orderId=123
But for some reason it is:
http://204435-204435/QuoteAndBook/Confirmation?orderId=123
The host portion of the link is generated using HttpContext.Current.Request.Url.Host but I would expect that to return "mysite.com", not "204435-204435".
Any idea what's going on?
Turns out the IT guy was changing something with the server configuration and broke it. Not sure what he did but he's fixed it now...

Resources