title: STHTTPRequest and php create a custom error code
body: <p>I'm using sthttprequest and php for webserver communication in my apps. This is a sample request: </p>
  
  <pre><code>-(void)GetSomething:(NSString*)Username :(NSString*)Password {
  
  
  __block STHTTPRequest *up = [STHTTPRequest requestWithURLString:[NSString stringWithFormat:@"%@%@",PATHSERVER,@"getsomething.php"]];
  
  up.POSTDictionary = @{@"username":Username,@"password":Password};
  
  up.completionBlock = ^(NSDictionary *headers, NSString *body) {
  
  
         //my result data
  
  
  
  
  };
  
  up.errorBlock = ^(NSError *error) {
      NSLog(@"-error description and error code- %@", [error localizedDescription]);
  
  };
  
  [up startAsynchronous];
  
  }
  </code></pre>
  
  <p>When a condition occurs i wanna output an error in my php page to display an alert in sthttprequest error's block:</p>
  
  <pre><code>up.errorBlock = ^(NSError *error) {
  NSLog(@"-error description and error code- %@", [error localizedDescription]);
  
  };
  </code></pre>
  
  <p>It is possible to force a custom code error from a php page to achive this behaviour? Something like:</p>
  
  <pre><code>&lt;?php  echo $custom_error_code; ?&gt;
  
  up.errorBlock = ^(NSError *error) {
  
    if (error.code==1300){
        //this is the code i have set in php
    }
  
  }; 
  </code></pre>
  
  <p>I don't want an already assigned error like 503,500,ect... because i risk to display the alert to the user when it makes not sense. I want to use the block error and not a simple string in the completionBlock for pratical reasons.</p>
  
  <p>EDIT</p>
  
  <p>I have found this answer here in stackoverflow 
  <a href="https://stackoverflow.com/questions/7996569/can-we-create-custom-http-status-codes">Can we create custom HTTP Status codes?</a> </p>
  
  <p>So i can create custom error code where the number isn't already assigned , what i have to respect is the class number 4xx or 5xx. Now my problem is to output a custom error code like "475" from a php page. The method </p>
  
  <pre><code>header_status(475);
  </code></pre>
  
  <p>dosen't work for me.</p>