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

Not loading body or header content from saved/recent calls #47

Closed
KrisZane opened this issue Aug 17, 2016 · 6 comments
Closed

Not loading body or header content from saved/recent calls #47

KrisZane opened this issue Aug 17, 2016 · 6 comments
Assignees

Comments

@KrisZane
Copy link

KrisZane commented Aug 17, 2016

First of all, awesome project, so happy to finally have a decent REST client, instead of having to install one in chrome.

It seems with my recent/saved requests, when I click them it loads none of the body content and only a single part of the header.

I checked collections.json and recent.json and all the information seems to be there, so I am guessing it is just a failed hookup of the data somewhere. :)

@javaguirre
Copy link
Contributor

Hi!

can you provide an example case where It fails? That way we can debug it faster.

Thank you! :-)

@KrisZane
Copy link
Author

KrisZane commented Aug 17, 2016

It currently seems to be failing in all cases, the URL is displayed correctly and so is the first line of header information, the rest of the header and the body are left blank.

This is an illustration of what it looks like when I click anyone of the recent or saved instances:
1471441590

I tried looking up in the code what might be the issue, but it seems your load function just reads the file and then passes it to the view, so I don't really see any reason for it breaking. :/

@javaguirre
Copy link
Contributor

I'll check it out.

@javaguirre javaguirre self-assigned this Aug 17, 2016
@KrisZane
Copy link
Author

KrisZane commented Aug 19, 2016

In case you want actual data to troubleshoot with, this is my collections file (some data is obfuscated for obvious reasons.):

[
  {
    "url": "https://api.trustpilot.com/v1/oauth/oauth-business-users-for-applications/accesstoken",
    "headers": {
      "User-Agent": "atom-rest-client",
      "Content-Type": "application/x-www-form-urlencoded",
      "Authorization": "Basic 123AbC=="
    },
    "method": "POST",
    "strictSSL": true,
    "body": "grant_type=password&username=abc&password=123"
  },
  {
    "url": "https://invitations-api.trustpilot.com/v1/private/business-units/123/invitations",
    "headers": {
      "User-Agent": "atom-rest-client",
      "Content-Type": "application/json",
      "Authorization": "Bearer 123"
    },
    "method": "POST",
    "strictSSL": true,
    "body": "{\n  \"recipientEmail\": \"kbo@trustpilot.com\",\n  \"recipientName\": \"John\",\n  \"referenceId\": \"inv00001\",\n  \"templateId\": \"123\",\n  \"locale\": \"en-US\",\n  \"senderEmail\": \"john.doe@trustpilot.com\",\n  \"senderName\": \"John Doe\",\n  \"replyTo\": \"john.doe@trustpilot.com\",\n  \"preferredSendTime\": \"2016-05-24T13:37:00+07:00\",\n  \"tags\": [\n    \"tag1\",\n    \"tag2\"\n  ],\n  \"redirectUri\": \"http://trustpilot.com\"\n}"
  },
  {
    "url": "https://invitations-api.trustpilot.com/v1/private/business-units/123/invitation-links",
    "headers": {
      "User-Agent": "atom-rest-client",
      "Content-Type": "application/json",
      "Authorization": "Bearer 123"
    },
    "method": "POST",
    "strictSSL": true,
    "body": "{\n  \"referenceId\": \"inv00001\",\n  \"email\": \"kbo@trustpilot.com\",\n  \"name\": \"John Doe\",\n  \"locale\": \"en-US\",\n  \"tags\": [\n    \"tag1\",\n    \"tag2\"\n  ],\n  \"redirectUri\": \"http://trustpilot.com\"\n}"
  },
  {
    "url": "https://api.trustpilot.com/v1/private/product-reviews/business-units/123/invitation-links",
    "headers": {
      "User-Agent": "atom-rest-client",
      "Content-Type": "application/json",
      "Authorization": "Bearer 123"
    },
    "method": "POST",
    "strictSSL": true,
    "body": "{\n  \"consumer\": {\n    \"email\": \"kbo@trustpilot.com\",\n    \"name\": \"John Doe\"\n  },\n  \"referenceId\": \"order1234\",\n  \"locale\": \"en-US\",\n  \"redirectUri\": \"https://www.example.com\",\n  \"products\": [\n    {\n      \"productUrl\": \"http://tp.com\",\n      \"imageUrl\": \"http://tp.com/boot.png\",\n      \"name\": \"Boots\",\n      \"sku\": \"sku1234\",\n    }\n  ]\n}\n{\n  \"referenceId\": \"order1234\",\n  \"email\": \"kbo@trustpilot.com\",\n  \"name\": \"John Doe\",\n  \"locale\": \"en-US\",\n  \"tags\": [\n    \"tag1\",\n    \"tag2\"\n  ],\n  \"redirectUri\": \"https://products.trustpilot.com/\"\n}"
  }
]

@javaguirre
Copy link
Contributor

javaguirre commented Aug 29, 2016

Hi!

I have replicated the bug, but I was thinking maybe It's better to have all the headers in the textarea, even the default ones as Postman does, so we don't have that separated.

I think the best thing to do would be to unify the user-agent and content-type inputs, remove those and add these default headers as text in the headers textarea, then when we load this data is also easier to load and less confusing this way IMHO.

What do you think @ddavison ?

@ddavison
Copy link
Owner

i definitely like that idea. really makes no sense to have them separated now that i think about 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

3 participants