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 7890949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:29:23+00:00 2026-06-03T06:29:23+00:00

I have write one method: -(id)postAndParseJson:(NSMutableDictionary *)theDictionary action:(NSString *)action type:(NSString *)myType { NSString *newJSON

  • 0

I have write one method:

-(id)postAndParseJson:(NSMutableDictionary *)theDictionary action:(NSString *)action type:(NSString *)myType {

    NSString *newJSON = [theDictionary JSONRepresentation];
    NSLog(@"what to send: %@", newJSON);

    NSURL *url = [NSURL URLWithString:@"http://api.uat.ushi.cn/user/getProfile?user_id=3"];
    ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
    NSLog(@"to url = %@",url);
    [request appendPostData:[newJSON dataUsingEncoding:NSUTF8StringEncoding]];

    [request startSynchronous];
    NSString *responseString = [request responseString];    


    NSMutableDictionary* responseDict = [responseString JSONValue];
    NSLog(@"responseString = %@",responseString);



    return responseDict;
}

the method is simple,just post the value and parse the return value,when I run it ,I get the console output:

2012-05-02 12:06:29.414 Ushi.com[775:f803] what to send: {"phone":"123456","password":"123456","user_name":"tan"}
2012-05-02 12:06:29.416 Ushi.com[775:f803] to url = http://api.uat.ushi.cn/user/getProfile?user_id=3
2012-05-02 12:06:29.449 Ushi.com[775:f803] -JSONValue failed. Error is: Illegal start of token [<]
2012-05-02 12:06:29.449 Ushi.com[775:f803] responseString = <html><head><title>Apache Tomcat/6.0.20 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 405 - Request method 'POST' not supported</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>Request method 'POST' not supported</u></p><p><b>description</b> <u>The specified HTTP method is not allowed for the requested resource (Request method 'POST' not supported).</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.20</h3></body></html>
(lldb) 

and it crash!but if I comment the line[request appendPostData:[newJSON dataUsingEncoding:NSUTF8StringEncoding]];I will receive the data,but it also crash.
thank you 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-03T06:29:25+00:00Added an answer on June 3, 2026 at 6:29 am

    That’s because what you get from server is not a valid JSON, but a plain html.

    The problem is that your server does not support POST , so it returns error page.

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

Sidebar

Related Questions

I have one method that receives a Stream to write on it using a
i have created one method to write to Log file but each time it
I have to write integration test case for my one feature listing page and
I have one problem, I learn how work with socket and I write programm
I have a class A and write a subclass B. A has only one
I have a C program like the one below. I am trying to write
I have one method that looks like this: void throwException(string msg) { throw new
I have such a problem: I want one method of the class to handle
If you have a controller method like so: @expose(json) def artists(self, action=view,artist_id=None): artists=session.query(model.Artist).all() return
Okay, I'm losing my mind over this one. I have a method in my

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.