Quectel M95 HTTP POST timeout error - post

I'm trying to send a POST to a server but I always get the +CME ERROR: 3821. I know that this means "HTTP to read timeout". Then, I tried to change the server to another one, just to test, and then I get the same error 3821. My AT commands list is:
AT+CGATT=1
AT+QIFGCNT=0
AT+QICSGP=1,"zap.vivo.com.br"
AT+QIACT
AT+QILOCIP (IP OK!)
AT+QHTTPURL=38,30
CONNECT
http://www.posttestserver.com/post.php
OK
AT+QHTTPPOST=10,50,80
CONNECT
helloworld
OK
+CME ERROR: 3821
Does anyone know what is wrong?

I solved it by using directly
AT+QHTTPPOST=10,50
and not
AT+QHTTPPOST=10,50,10

hello even the issue is one year old i am writing answer if any one needs. In the source file of "ril_http.c" of Quectel modules, add delay of minimum 10ms in HTTP call back handler. it will solve the timeout error and will able to post it successfully.

Related

expected status code in (200-299) got 503

I got the following error
expected status code in (200-299) got 503.
I didn't get this all the time. Sometimes I notice this error. I am unable to figure out the exact reason.
The base URL I am using in the application is in following format.
BaseURL: https://staging.something.com
For every request I append to base url as follows.
"BaseURL/api/"
Please let me know if any issues.
503 means service unavailable. Lots of servers give that for lots of reasons.
2xx means that something normal happened
See http://en.wikipedia.org/wiki/List_of_HTTP_status_codes
503 means "Service Unavailable".
Which means there is a problem on the server side.
Make certain that the URL you are connecting to looks like a valid URL. For example, you can do something like:
NSLog(#"the url I am connecting to is %#", [myURL absoluteString]);
And see if it matches what you were expecting: https://staging.something.com/api/.
If it looks really wrong, like "apihttps://staging.something.com", then it's something that you can easily fix.
If you are getting this problem all the time, you should probably reach out to the owner of the service you're trying to use and ask them for assistance.

Checking HEAD from NSMutableURLRequest without Error

I'm working on a program for the iPhone and I ran into a bit of a snafu. I want to load a URL into a WebView, however, I want to make sure that the URL actually exists and is working before trying to load it into the view.
Imagine you have 200 servers and you know your file exists you just don't know which server. It is at http://serverXXX.mydomain.com/myfile.html where XXX is the server # 0 through 200
I wrote a bash script that uses cURL to loop through the servers checking the HEAD request of each iteration of the url and timing out after 1 second:
http://server1.mydomain.com/myfile.html
http://server2.mydomain.com/myfile.html
...
http://server199.mydomain.com/myfile.html
http://server200.mydomain.com/myfile.html
When it gets back a response it greps the response and compares it. If the response is OK it loads the URL in an external program and exits the script. How do I do this in Objective-C without the error "The requested URL was not found on this server." popping up?? I don't want to click OK 200 times while it tries to find the correct URL.
You can do the same as your script with an instance of NSMutableURLRequest and a NSURLConnection. You can set the request to HEAD (setHTTPMethod:) and iterate over the server URLs updating the request after each response (connection:didReceiveResponse:) is received.

Issue with the rails (2.3.11) server(production side)

I am stuck with a very unusual issue. I am trying to call a webservice request from the server (actully an ajax 2 step request from the client side) for which i am getting an xml formatted response which i am parsing using a treeview. The issue is..its working well in development mode on local server but showing error in production with the same codes. When I initiate a request I get a response for the first step in string format but showing error "error loading xmlDoc: xmlDoc is undefined" for the second request which suppose to be initiated directly after the first response.
codes are available here:
https://github.com/domthu/microaquadt/blob/master/app/views/oligo_sequences/edit.html.erb
error is somewhere on the function starting from line 195.
Any help or suggestion would be much appreciated...!!!!

Create time out scenario in SOAPUI

I am working on a web-project. I have created one Http Url Connection. But for that, I have to test the code for time-out InterruptedIOException, that will execute on time-out, but even after setting time-out time as 1msec, my case is executed successfully.
How can I make delay from SOAPUI, so that I can have time-out successfull?
If you want to test how a client will react to a timeout, create a mockservice in SoapUI, and have it execute an OnRequest script prior to returning the (usually pre-determined) response. The script can be as simple as:
sleep(60000)
This would give you a 60-second delay before responding.
Select your response in the tree.
Then at the bottom in "MockResponse Properties" look for:
If you need to simulate a timeout thrown from an HTTP connectivity,
then better use the script
mockRequest.getHttpResponse().sendError(408)
This will generate an html response as well. You may set any HTTP code status you desire.
You may put it in "OnRequest Script", or in the "Script" of an existing Mock Response.
Use HTTP STatus property of Response Message set the value to 408

405 Method not allowed on Net::HTTP request [ruby on rails]

I'm trying to verify if there is a remote url with following code:
endpoint_uri = URI.parse(#endpoint.url)
endpoint_http = Net::HTTP.new(endpoint_uri.host, endpoint_uri.port)
endpoint_request = Net::HTTP::Head.new(endpoint_uri.request_uri)
endpoint_response = endpoint_http.request(endpoint_request)
I'm still getting 405 Method not allowed. When I use Get instead Head in Net::HTTP::Head.new I'm getting 200 Success but also with whole remote document in response what results in bigger response time (0.3s => 0.9s).
Any ideas why this is happening? Thx
There's a chance that the #endpoint url you're trying to interact with doesn't support HEAD requests (which would be really weird, but still may be the case). Your code works fine for me with a handful of urls (google.com, stackoverflow.com, etc.)
Have you tried a curl request to see what it returns?
curl -I http://www.the_website_you_want_to_test.com

Resources