login about faq

I was just wondering was qualifies as an error condition with http.QuickGetStr?

I could also rephrase my question slightly: If I make a request that returns a 404 NOT FOUND, then the request fails. I suppose you could argue that this qualifies as an error condition, but what if I use it simply to test for existence of record of some sort. In that case I want to know that the 404 was returned, but the request was received and understood by the server.

I know that may by approaching this in a bad way, and that the solution should be to not return a 404, but e.g. a 204 or similar instead. In know that using the 404 on purpose is dangerous, because I would be able to tell if the 404 was returned on purpose or because I requested an invalid URL.

asked Dec 04 '12 at 10:44

roan98dk's gravatar image


If the HTTP request is successfully sent, and the response is successfully received, even if a 404 response, then it is deemed a success. Your app can check the http.LastStatus method to get the HTTP response status code (such as 200, 204, 404, etc.).


answered Dec 04 '12 at 12:58

chilkat's gravatar image

chilkat ♦♦

Strange. I am pretty sure that the request failed even on the 404 response. That is the reason for my question.

I know about the LastStatus.

(Dec 04 '12 at 13:10) roan98dk

This may be a fix in the newest to-be-released version (v9.4.0). What operating system / programming language do you use?

(Dec 04 '12 at 13:11) chilkat ♦♦

Windows 7 64-bit, Visual Studio 2012, VC++ 11 / win32.

(Dec 04 '12 at 13:15) roan98dk

Unfortunately, that's one platform where I cannot provide an immediate build.

(Dec 04 '12 at 13:17) chilkat ♦♦

I can live with the workaround for now. I am anyhow considering the alternative of not returning a 404, since I have to be absolutely certain that the queried url is correct at all times. If I make an error in the url, I cannot trust the 404 default server response.

(Dec 04 '12 at 13:20) roan98dk

I did another quick test of QuickGetStr and it definitely fails on the 404, but the workaround of checking for 404 afterwards works fine.

(Dec 04 '12 at 13:22) roan98dk
showing 5 of 6 show all
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Dec 04 '12 at 10:44

Seen: 1,253 times

Last updated: Dec 04 '12 at 13:22

powered by OSQA