Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to set acceptableContentTypes? #40

Open
hundredlee opened this issue Sep 26, 2017 · 2 comments
Open

how to set acceptableContentTypes? #40

hundredlee opened this issue Sep 26, 2017 · 2 comments

Comments

@hundredlee
Copy link

how i can set acceptableContentTypes .when the response data is not json?

error info: 
Error Domain=com.alamofire.error.serialization.response Code=-1016 "Request failed: unacceptable content-type: text/html" UserInfo={NSLocalizedDescription=Request failed: unacceptable content-type: text/html, NSErrorFailingURLKey=

@hundredlee
Copy link
Author

hundredlee commented Oct 1, 2017

i use my way to deal with this problem.
open the file XMEngine.m.In line 495 ,cancel this annotation .

_afJSONResponseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json",
 @"text/javascript", @"text/html", @"text/plain", nil];

it's a stupid way to deal.looking forward to the author to deal with it.thx

@westke
Copy link

westke commented Jan 12, 2018

[[XMEngine sharedEngine].sessionManager.requestSerializer setValue:@"whatyouwanttomodify" forHttpHeaderField:@"Content-Type"];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants