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

XMLRPCRequestConvertible #29

Open
pdegouville opened this issue Mar 29, 2019 · 6 comments
Open

XMLRPCRequestConvertible #29

pdegouville opened this issue Mar 29, 2019 · 6 comments

Comments

@pdegouville
Copy link

I am trying to use the protocol XMLRPCRequestConvertible, but I am asked to implement the asUrlRequet() function, which is not in the protocol. I found tha it is defined in an extension of the protocol. how to use the function that you write and not have to rewrite it ?

@kodlian
Copy link
Owner

kodlian commented Mar 29, 2019

I think your issue is due to the internal scope of this implementation. The asUrlRequest() implementation should be public. Please could you test this hypothesis?

@pdegouville
Copy link
Author

pdegouville commented Apr 2, 2019

Good ! That solve the issue. Many thanks !

@pdegouville
Copy link
Author

I have another Request. I have to send a pdf that should be wrapped it with the xml tag. So, it should be a Data type. But it appears that what i should send within this tag is a string which comes from :

let fileData = NSData(contentsOf: fileUrl!)
let fileAsStringBase64: String = fileData!.base64EncodedString(options: .lineLength64Characters)

if I use this piece of code, i get the right string, but embedded in the xlm tag

Is their a way to solve this issue and wrap it with ? ?

@kodlian
Copy link
Owner

kodlian commented Apr 2, 2019

A Data should be converted to a base64 string. Did you defined your data parameters as Data or NSData (you should use the swift one Data) ?

@kodlian
Copy link
Owner

kodlian commented Apr 2, 2019

@pdegouville By the way feel free to submit a fix for the public asUrlRequest implementation.

@pdegouville
Copy link
Author

Hello,
Well, I am quite new as a developer and I really don't know how to submit a fix. I think it's probably better and safer to let you do it. :-)

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