Skip to content

RestApiToText Notepad++ plugin that uses input from an editor tab to make a REST call and display the results in a new tab.

License

Notifications You must be signed in to change notification settings

eljefe7000/RestApiToText

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RestApiToText for Notepad++

RestApiToText is a plugin that will use the text from a Notepad++ editor tab to make a REST call and display the results in a new editor tab, eliminating the need for calling an outside REST tool and pasting the results into Notepad++. Special thanks to Don Ho and the many developers and contributors for making Notepad++ possible.

License

All files for this package are licensed under the GPL v3 license.  See the LICENSE file for more details.

What's New in RestApiToText

  1. Added the ability to use an environment variable when specifying header values, so that you can use a private API key without showing it in your REST call.
  2. RestApiToText will automatically pretty-print JSON responses if the response header's Content-Type header is set to application/json.
  3. Added new RestApiToTextOptions section to allow users to control the behavior of RestApiToText.
  4. Added the ShowResponseHeaders RestApiToText option to display response headers in addition to the response itself.
  5. Querystrings are now url-encoded before they are sent.
  6. Added the ability to pass a body with the DELETE verb.
  7. Fixed issue where the PATCH verb was not passing the body.
  8. Fixed issue where InternetReadFile was stopping prematurely because the output was being formatted to JSON as it was being read.
  9. Fixed issue where the 201 (Created) response was not returning the body.
  10. Added ability to use environment variables in the body and the URL.
  11. Added ability to show response on the same page, after the REST call.
  12. Fixed issue where body was not being returned on all calls.

New Releases

You can download the latest version of RestApiToText.dll for 32-bit here and for 64-bit here or by navigating the Release and x64/Release folders above. You just need to download the DLL and overwrite it in the appropriate subfolder of the Notepad++ plugins admin folder.

Here are the steps to overwrite the DLL:

  1. Open Notepad++ and go to Plugins->Open Plugins Folder...
  2. Close Notepad++.
  3. In the Explorer window you created from Step 1, open the RestApiToText subfolder.
  4. Overwrite the RestApiToText DLL with the one you downloaded.
  5. Reopen Notepad++.

See Changes by Version below for a list of changes.

Usage

  1. Add code in the format shown below.
  2. Go to Plugins -> REST API To Text -> Make REST Call.
  3. A new editor tab with the results of the call should appear. (Results depend on the API you call)

screenshot screenshot

  1. If the response's Content-Type header is application/json then the output will be automatically formatted:

screenshot

Notes

  • RestApiToText always creates a new tab for the results, so you can easily keep different versions for reference.
  • Only the verb and the URL are required.  Headers, RestApiToTextOptions and Body are always optional.
  • The HTTP/S protocol at the beginning of the URL is not required. The port is also optional.
  • The current version of the plugin will only make one call at a time.
  • If the editor tab contains more content than your REST call (or other non-REST content), then select all of the REST text before making the call.
  • You can also make calls to regular web pages.
  • RestApiToText also supports the most commonly used REST verbs.  The content returned depends on the API call.  Some verbs might return no content, depending on the REST API you're calling and how you've configured the call.  Here are some examples:

screenshot

screenshot

screenshot

screenshot

  • Use an environment variable whenever you want to send a private API key but you don't want to show it in your REST call.  Just create the variable and wrap it in a $(env:variable name) expression, like so:

screenshot screenshot

screenshot

screenshot screenshot screenshot screenshot screenshot screenshot

  • Use the RestApiToTextOptions section for custom RestApiToText features: (The following two features are currently available)

screenshot

Changes by Version

1.4.0.1

  1. Fixed issue where body was not being returned on all calls.

1.4.0.0

  1. Added the ability to use an environment variable in the body and the URL.
  2. Added the ability to show the response on the same page as the REST call.

1.3.1.2

  1. Added the ability to use an environment variable in the body.

1.3.1.1

  1. Fixed bug where 201 responses did not include the body.

1.3.1.0

  1. Added the ability to use an environment variable when specifying header values, so that you can use a private API key without showing it in your REST call.

1.3.0.0

  1. Added new RestApiToTextOptions section to allow users to control the behavior of RestApiToText.
  2. Added RestApiToText option called ShowResponseHeaders to display response headers in addition to the response itself.
  3. URL querystrings are now encoded before they are sent.
  4. Added the ability to pass a body with the DELETE verb.
  5. Fixed issue where the PATCH verb was not passing the body.

1.2.1

  1. Fixed issue where InternetReadFile was stopping prematurely because the output was being formatted to JSON as it was being read.

1.2

  1. Added JSON pretty-printing for responses with a Content-Type response header containing "application/json".
  2. Added support for the HEAD and OPTIONS verbs.
  3. URLs with no verb now default to a GET.

1.1

  1. Fixed incorrect HTTP/S configurations that would result in "400 - Bad Request" or "405 - Method Not Allowed" in some situations.
  2. Disabled default WinInet caching.

1.0

  1. Initial release.

About

RestApiToText Notepad++ plugin that uses input from an editor tab to make a REST call and display the results in a new tab.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published