Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8909891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:32:59+00:00 2026-06-15T03:32:59+00:00

Is my first attempt on this and I am facing the error Expected status

  • 0

Is my first attempt on this and I am facing the error

Expected status code in (200-299), got 404

I am following this tutorial > link

and I have create the class below:

TalkToNetwork.h

#import "AFHTTPClient.h"
#import "AFNetworking.h"

typedef void (^JSONResponseBlock)(NSDictionary* json);

@interface TalkToNetwork : AFHTTPClient

@property (strong, nonatomic) NSDictionary* user;

-(BOOL)isAuthorized;

-(void)commandWithParams:(NSMutableDictionary*)params onCompletion:(JSONResponseBlock)completionBlock;

+(TalkToNetwork*)sharedInst;

@end

TalkToNetwork.m

    #import "TalkToNetwork.h"

//the web location of the service
#define kAPIHost @"http://localhost/"
#define kAPIPath @"Test/"

@implementation TalkToNetwork

@synthesize user;

+(TalkToNetwork*)sharedInst{

    static TalkToNetwork *sharedInstance = nil;
    static dispatch_once_t oncePredicate;
    dispatch_once(&oncePredicate, ^{
        sharedInstance = [[self alloc] initWithBaseURL:[NSURL URLWithString:kAPIHost]];

    });

    return sharedInstance;
}

-(BOOL)isAuthorized{

    return [[user objectForKey:@"IdUser"] intValue] > 0;
}

-(void)commandWithParams:(NSMutableDictionary*)params onCompletion:(JSONResponseBlock)completionBlock{

    NSMutableURLRequest *apiRequest =
    [self multipartFormRequestWithMethod:@"POST"
                                    path:kAPIPath
                              parameters:params
               constructingBodyWithBlock: ^(id <AFMultipartFormData>formData) {
               }];

    AFJSONRequestOperation* operation = [[AFJSONRequestOperation alloc] initWithRequest: apiRequest];
    [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
        //success!
        printf("success");
        completionBlock(responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        //failure :(
        printf("failure");
        completionBlock([NSDictionary dictionaryWithObject:[error localizedDescription] forKey:@"error"]);
    }];

    [operation start];
}


-(TalkToNetwork*)init{

    self = [super init];

    if (self != nil) {
        user = nil;

        [self registerHTTPOperationClass:[AFJSONRequestOperation class]];

        [self setDefaultHeader:@"Accept" value:@"application/json"];
    }

    return self;
}

@end

I have downloaded and installed XAMPP as tutorial advice, running all three Controls (Apache, MySQL, FTP) and I have used phpmyadmin in order to create the database and a table (“login”) manually.

I am following each step from the tutorial and still getting the error above. In addition, I’m passing manually the link to the browser “http://localhost/Test/&#8221; and getting Error 404.
What I am missing here?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T03:33:01+00:00Added an answer on June 15, 2026 at 3:33 am

    You’re passing in a URL that is not valid. Check in your browser the URL ..

    1. Check if Apache is running at http//localhost/ or http://172.0.0.1/ or.. http://localhost:8080/
    2. Check if PHP is working well http://localhost/test/index.php
    3. …

    UPD

    from tutorial:

    “The extracted ZIP should contain a few PHP files and a folder named
    “upload. The main API file is index.php”

    … then.. “

    copy the files in Finder to your web folder”

    …

    ” you will have to change the domain and path if you have any setup
    other than calling the API from your local machine”

    Perhaps.. you must try http://localhost/xampp/test/

    UPD2

    Error 403 Access Forbidden:

    1
    a) In Finder select test folder
    b) Choose ‘Show info’
    c) Under “Ownership & Permissions” check to have you read\write permission

    2
    check\modify your httpd.conf from “Deny from all” to “Order allow” and “Allow from all” – like here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First attempt to use this cool site - after searching for 2 hours: So
Because this is my first attempt at an extension method that seems quite useful
This is my first attempt at responsive design, so I'm keeping it simple. I
Up front: This is my first attempt at an Android app. I'm in that
This is my first attempt to write shorthand if statements however am befuddled by
this if my first attempt at using streaming for WCF, and I am struggling
This is my first attempt to create a GUI in MATLAB. I haven't been
this is my first attempt at a responsive design so excuse me if this
This is pretty strange (admitedly, this is my first attempt with python / sqlite),
I'm trying to create a simple threading procedure (granted this is my first attempt

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.