Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Lewis Cowles
    @Lewiscowles1986
    It's probably not good enough yet
    • a bit long
    • trivial examples
    Olle Jonsson
    @olleolleolle
    A short note: The section on "looks like Requests" may seem alien to a Ruby reader. Also: That functionality – even automatically, to sense whether data is already "stringified" – is already in the :json request and response Middlewares.
    Lewis Cowles
    @Lewiscowles1986
    Nice. Pro-tips
    currently getting Jekyll setup so I can view the thing I PR'd :blush:
    Olle Jonsson
    @olleolleolle
    Did you use tabs to indent? It should be 2 spaces, for Ruby code.
    Lewis Cowles
    @Lewiscowles1986
    One day I'll have a .editorconfig that helps me :wink:
    not on work laptop either. This is my new shiny Debian buster install
    vs codium is ... less feature packed than the microsoft official code. Perhaps I will try RubyMine soon
    Olle Jonsson
    @olleolleolle
    Congratulations!
    Olle Jonsson
    @olleolleolle
    Perhaps the testing article could link to HTTP-related testing tooling in general, tools explained elsewhere? For example "You can use vcr to record and replay HTTP interactions. Here's vcr's homepage."
    Lewis Cowles
    @Lewiscowles1986
    I have to confess. I've not used vcr in any language. I'd be less help. I think that might lend itself to another page?
    or does VCR automate handling red cases?
    I thought it bypassed them
    Olle Jonsson
    @olleolleolle
    Or "RSpec offers test spies, allowing you to check things were called."
    Lewis Cowles
    @Lewiscowles1986
    I take it I'm teaching bad habits
    I've used spies. This first part was specifically about testing red-cases
    i.e. timouts, connection errors
    Olle Jonsson
    @olleolleolle
    I think the Issue you posted is grand. It is a real need: "OK, I'm using Faraday, let's say I can set up a failure 503 on a specific URL. How do I check that my middleware stack raises the correct error?"
    Lewis Cowles
    @Lewiscowles1986
    Btw I get an error when generating docs
      Conversion error: Jekyll::Converters::Scss encountered an error while converting 'assets/css/main.scss':
                        File to import not found or unreadable: type-theme. Load paths: /faraday/docs/_sass /usr/local/bundle/gems/jekyll-theme-primer-0.5.2/_sass on line 2
    I'm running in the Jekyll official docker to avoid putting runtimes on my nice clean install. I think perhaps github-pages is a bit behind on their jekyll. I will see if I can locate a more appropriate container
    Olle Jonsson
    @olleolleolle
    Type-theme comes from configuration we did.
    It's an online resource.
    Lewis Cowles
    @Lewiscowles1986
    Are you manually building the docs instead of relying on github-pages?
    Olle Jonsson
    @olleolleolle
    Another testing tool which could assist someone, but also isn't about Faraday "Use WebMock to fake responses from the Web"
    https://github.com/bblimke/webmock#setting-expectations-in-rspec-on-webmock-module
    image.png
    This is how I try out the content; inside the docs/ directory, jekyll server
    Lewis Cowles
    @Lewiscowles1986
    wonderful. I have a separate PR for the docs
    according to benbalter (nice guy, I've learned much Jekyll from him), we need to add plugin to our _config.yml
    the inverted mark of the beast lostisland/faraday#999
    Olle Jonsson
    @olleolleolle
    Could I suggest a name for that PR? "Add Jekyll plugin jekyll-remote-theme to support Docker usage"
    Lewis Cowles
    @Lewiscowles1986
    Of course you can
    I'm more friendly outside of work lol
    can I suggest changing "add" to "configure"?
    it was added by someone else in the Gemfile
    Olle Jonsson
    @olleolleolle
    Good detail!
    I'm authoring some review comments on the initial PR.
    Lewis Cowles
    @Lewiscowles1986
    :+1: WebMock & VCR would be great candidates for further docs. I have no idea how long those will take me
    Lungu Alexandru-Mihai
    @LunguAlexandruMihai
    Hi guys, i hope you are doing well ! I have a little problem with walmart seller api and faraday. I am trying to upload the feed file and they told me to remove boundary message from my request. How i am gonna do this ? Thank you so much!
    Matt
    @iMacTia
    HI @LunguAlexandruMihai! That’s a strange request, but not having used the Walmart Seller API before I can’t really tell why that’s needed. Anyway, the boundary message is added by the multipart-post middleware, so the only way to remove it is by adding a custom middleware to do so. You can find more details on how to create your own middleware here
    After you’ve created your custom middleware, you simply need to add it to your connection AFTER the multipart-post one
    that should be all you need to accomplish what you want, but if you get stuck and can’t figure out how to progress feel free to reach out :thumbsup: !
    Charles Bandes
    @Bandes
    This message was deleted
    Rui Soares
    @RuiSoares
    Hi guys, first of all great job with faraday! Second, I have a question regarding SSL certificates. I need to add an intermediate certificate, "ca.pem", to my requests and when I do it on a CURL request I use the "--cacert" tag and it works fine. I'm having some trouble understanding how this translates to faraday. I assume I should do it through the "ca_file" option but I can't get it to work, what should I pass as "ca_file"?
    Matt
    @iMacTia
    Hi @RuiSoares, apologies for the lack of documentation around certificates, the main reason is that they’re not too consistent beteween the different adapters. Assuming you’re using the default adapter (Net::HTTP), then you have a lot of properties supported: https://github.com/lostisland/faraday/blob/master/lib/faraday/adapter/net_http.rb#L152
    You can provide them while creating the connection, for example if you need to set the ca_file you can do so like this
    conn = Faraday.new(…, ssl: { ca_file: ‘/path/to/the/ca.pem' })
    As for the exact value for ca_file, that mostly dipends on the adapter. For Net:HTTP it seems like a File or a file path should work, but different adapter (and thus libraries) this might be different
    Rui Soares
    @RuiSoares
    Hi @iMacTia, thank you. I will try that and get back to you with the outcome.
    Rui Soares
    @RuiSoares
    It worked, thanks a lot @iMacTia
    Matt
    @iMacTia
    :tada: