Git Product home page Git Product logo

Comments (6)

MugunthKumar avatar MugunthKumar commented on August 15, 2024

I'm still thinking of a good architecture for this, without adding a parameter.
For example, setting it in the Engine subclass and all operations created on the Engine uses the same encoding.

from mknetworkkit.

eric-sofisoftwarellc avatar eric-sofisoftwarellc commented on August 15, 2024

So, if you wanted to do different requests with different content types, you'd use different engines?

from mknetworkkit.

MugunthKumar avatar MugunthKumar commented on August 15, 2024

MKNetworkEngine should be subclassed for every different server you connect to from your app.
How often would you have a server that uses different content type encoding for different end points?
Does that make sense or am I over assuming?

from mknetworkkit.

eric-sofisoftwarellc avatar eric-sofisoftwarellc commented on August 15, 2024

Um, in my case I have a server that has different content type... but I can just use different engines for each type, it'd be a simpler api.

from mknetworkkit.

jomnius avatar jomnius commented on August 15, 2024

Since current version of initWithURLString contains switch (self.postDataEncoding) and there is no dynamic way to set self.postDataEncoding, it seems like a potential API design issue or that I'm using (something) in wrong way.

Would prefer API extension, but updated docs are fine, too.

In case it makes any difference, I need to post json inside multipart.

from mknetworkkit.

triage avatar triage commented on August 15, 2024

same issue here ... I have one engine, one server, but depending on the method to post to, two different types of content-type to send. An additional helper method might be the only way, unfortunately :/

from mknetworkkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.