Giter VIP home page Giter VIP logo

Comments (8)

versaielle avatar versaielle commented on July 18, 2024

It seems to the serialization to me.. resp.Content = resp.Content.TrimStart(byteOrderMarkUtf8.ToArray()

is not plugging anything in .data

from harvest.net.

marioharper avatar marioharper commented on July 18, 2024

I'm thinking it may be due to this issue I logged for the api: https://github.com/harvesthq/api/issues/120
Will retest once the issue is resolved.

from harvest.net.

ithielnor avatar ithielnor commented on July 18, 2024

Maybe, but I think we use XML exclusively since I found too many inconsistencies in Harvest's json responses. I don't think we request application/json anywhere.

from harvest.net.

hbgwhite avatar hbgwhite commented on July 18, 2024

HarvestXmlDeserializer Deserialize(IRestResponse response) is not being called for this project call.

The content-type for returned projects is application/json. I think that's the problem.

from harvest.net.

hbgwhite avatar hbgwhite commented on July 18, 2024

Here is my hack-tastic solution:

// Harvest API is inconsistent in JSON responses so we'll stick to XML
_client.ClearHandlers();
_client.AddHandler("application/xml", new HarvestXmlDeserializer());
_client.AddHandler("text/xml", new HarvestXmlDeserializer());
_client.AddHandler("application/json", new HarvestXmlDeserializer());

Since the harvest API is returning body xml but application/json as the header content type, I've set the application/json handler to the XmlDeserializer. The other responses that faithfully represent their content types should be unaffected. I'm going to post a bug to the Harvest API people.

from harvest.net.

ithielnor avatar ithielnor commented on July 18, 2024

It's definitely sub optimal, but as long as their api is serving it wrong I guess we can do that.

Submit a PR and I'll get this up on Nuget.

from harvest.net.

ithielnor avatar ithielnor commented on July 18, 2024

Jonathan says it is fixed: https://github.com/harvesthq/api/issues/120#issuecomment-97552573

Test and let me know if we still need a patch.

from harvest.net.

marioharper avatar marioharper commented on July 18, 2024

Retested, its working properly now. Thanks.

from harvest.net.

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.