-
Notifications
You must be signed in to change notification settings - Fork 15
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
fix a parameter name issue, add a synchronous request call #2
Conversation
@@ -63,20 +70,29 @@ public class YYHRequest: NSObject, NSURLConnectionDataDelegate { | |||
} | |||
|
|||
public func loadRequest() { | |||
if (parameters.count > 0) { | |||
if (parameters.count > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation in this file seems to be really off, lots of extra spaces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was in TextMate and didn't notice that, sorry.
@georgetso I'm not sure I understand the issue with the query string. Query strings are required to start with |
|
||
let request = YYHRequest(url: NSURL(string: "http://www.google.com/")) | ||
|
||
let responseData = request.loadImmediately() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the benefit of loading requests synchronously?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my project I need a synchronous request, so I put it in in case other people would need it, too.
Yes, a question mark should be leading parameters like http://www.google.com/?name=value&foo=bar after I removed that "?" in code, everything works as expected. |
@georgetso this sounds like a misconfiguration on your server. The |
I don't know, man. I'm not a server guy, never get my hands on IIS. The server guy told me the question mark thing, I have to believe him. |
I see your issue now. GET requests serialize the parameters as query string values. POST, PUT, DELETE serialize the parameters in the request body. The 2cfe31f fixes the issue |
great, glad to help, and thanks for the wonderful job. Your work saved lot of my time. |
let request = YYHRequest(url: NSURL(string: "http://www.google.com/"))
request.parameters["name"] = "value"
Microsoft IIS would've got a parameter name as "?name". This patch fixed it.