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

Parameter is a transformation that not expect. #182

Closed
yoneapp opened this issue Oct 19, 2015 · 3 comments
Closed

Parameter is a transformation that not expect. #182

yoneapp opened this issue Oct 19, 2015 · 3 comments

Comments

@yoneapp
Copy link
Contributor

yoneapp commented Oct 19, 2015

Hi,

In such a case,

let params = ["param": "param1", "array": ["first array element","second","third"], "num": 23, "dict": ["someKey": "someVal"]]
do {
    let opt = try HTTP.POST("https://domain.com/new", parameters: params)
    opt.start { response in
        //do things...
    }
} catch let error {
    print("got an error creating the request: \(error)")
}

I expect such a request parameters format.

array[]="first array element",
&array[]=second
&array[]=third
&num=23
&dict[someKey]= someVal
&param=param1

However, the actual results are as follows.

array=(
    "first array element",
    second,
    third
)&num=23&dict={
    someKey = someVal;
}&param=param1

I need to ask your advice on something.

daltoniam added a commit that referenced this issue Oct 19, 2015
@daltoniam
Copy link
Owner

Thanks for the report, there was a bug. Not sure why, but protocol conformance in Swift didn't work the way I thought it would. Anyway, the fix is in master, I will do a new release shortly.

@daltoniam
Copy link
Owner

Tag 1.0.2 released.

@yoneapp
Copy link
Contributor Author

yoneapp commented Oct 22, 2015

Parameter was converted correctly. Thanks.

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