How to handle the push data - asp-classic

I dont understand the explanation on the website.
https://developer.foursquare.com/overview/realtime
I am working with classic asp, do they refer to a query string or a form when they say parameter.
I received the following error; Your Server returned: 502 Bad Gateway.

Bad gateway means that your script is trying and failing to connect to an external url

Related

HTTP Error 403.0 - ModSecurity Action

I m creating a code in which based on query string the URL is changing when no values are supplied in URL everything is working fine but as i supply values to URL it shows Error HTTP Error 403.0 - ModSecurity Action
Kindly suggest some solution
also the same is working fine in local problem occurs when i upload my webpage to server
I know this is an old thread, but posting the answer so that it can be helpful for others. ModSecurity is an open source, cross-platform web application firewall (WAF) module.
https://modsecurity.org/about.html
So whenever you see the 403 (ModSecurity Action), this means that the mod security firewall has blocked the request. The probable cause could be vulnerable data present in the posted data, or the it could be because of the URL posted as parameter or it could be JavaScript.
In above case, the ModSecurity might have deemed the input as SQL Injection attack and hence may have blocked it. If you look into the logs of the firewall it may give you the detailed explanation.
In my case, I was passing URL as query parameter in the request hence it was returning 403.

Is there a way to provoke server-side errors from client?

I'm sending GET requests to Trello API, and I need to test my error handling script. Can I send something that will reliably provoke server-side error?
If all you need to do is have a server generate HTTP error code replies, and you are fine with not using the real Trello API server (but can switch to another host), you could give HttpBin a try. It's a free, anonymous, hosted service that just replies with whatever status you ask it for.

Error 400 happened while getting response from uri

I have problem with use of URL. There is a bug related to web API. I need to update data in database using rest APIs. But the URL I have to update the data in database is throwing error:
“The remote server returned an error: (400) Bad Request”.
so I am not understanding whether it's wrong with my code or with URL I have. So please suggest your ideas regarding this.

Why am i getting a 505 error code from the server?

I looked up the 505 response code and saw that it was "The Web server (running the Web site) does not support, or refuses to support, the HTTP protocol version specified by the client"
The web site I am trying to access on the web server is https://query.yahooapis.com/v1/public/yql?q=select * from yahoo.finance.quote where symbol %3D"msft"&diagnostics=true&env=store
I was able to get on the site and see that it provided xml data. However when I tried to make a HttpsURlConnection with that site, I got a 505 response code, code for doing so is
URL url = new URL(params[0]);
URLConnection connection = url.openConnection();
HttpsURLConnection httpConnect = (HttpsURLConnection) connection;
int responseCode = httpConnect.getResponseCode();
where i inspected the value of params[0] at runtime and saw that it had the right url in it. Does anyone know how i can fix this issue? The web server should support https because that link works. I don't understand why a 505 error is occuring then.
java.net.URL will allow you to create an invalid URL with spaces, which results in this error. Spaces in query parameters should be encoded as +, so make your URL:
https://query.yahooapis.com/v1/public/yql?q=select+*+from+yahoo+finance.quote+where+symbol+%3D"msft"&diagnostics=true&env=store
This request is still incorrect, and will result in a 400 ("expecting table got 'finance'"). From these questions:
Getting data from Yahoo Finance
Issue with AngularJS and financial quote
I believe you want:
https://query.yahooapis.com/v1/public/yql?q=select+*+from+yahoo.finance.quote+where+symbol+%3D"msft"&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys
I think i got the problem. I looked online and saw that someone else had the problem and that it was the spaces inside the url. I am not sure how to resolve this though

How to ping a webservice like svc, asmx

I have .net application and I want to ping some webservices and show the status on a webpage.
I tried ping but i am getting "No such host in known".
But the ping works for a url or ip but not working for a service.
Please put ideas here
UPDATE:
I used HttpWebResponse and request. I am getting 401 unauthorized.
Use a head HTTP verb to check. "This method is often used for testing hypertext links for validity, accessibility, and recent modification."
What are you pinging? If you want to check to see if a webservice is there, then just navigate to the full URL of the service and see if you get a page not found or not. In a webpage, you could even get fancy and check it using an ajax request (look up Microsoft.XMLHTTP)
Funny you should ask this because every webservice I have developed, the first method I add to it is ping :) which returns it's state in a one liner that can be displayed on a form.
What if you try to ping the Web Service address instead of the entire End Point? Basically an EndPoint is composed by an Address an a location.Let's suppose you have the following Web Service called CustomerService.svc.
http://myserver.somedomain.com/services/CustomerService.svc
You should try the ping to the address which is myserver.somedomain.com.Also you should consider that some servers have the ping command disabled.
You can download an application such as WCF Storm or SOAP UI that will act as a client to your WCF service. Both have free versions, I believe. They will let you construct an XML request to test the service.
Also, I like to put an actual Ping method in my services that receives an int and returns a string with the same int and a timestamp. It's not strictly necessary, but it helps as a sanity check in a pinch.

Resources