question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support modifying transport request objects before request is sent

See original GitHub issue

How to access superagent’s request obj?

I need to call withCredentials() on the request obj to deal with CORS. How to do it without overriding all the methods that http-transport exports (delete, get, head, post, put)?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:5

github_iconTop GitHub Comments

3reactions
kadamwhitecommented, Jan 24, 2019

A good solution to this problem should permit an application author to introduce any of the following into their request chain:

  • Proxy options
  • Credentials / CORS configuration
  • Request Logging

This may also be useful for custom authentication providers.

2reactions
unematiiicommented, Jun 29, 2017

Workaround: Cloned the contents of http-transport.js + added defaults for superagent:

var agentDefaults = require( 'superagent-defaults' );
var agent = agentDefaults();
agent.withCredentials();

/**
 * Conditionally set basic authentication on a server request object
...

import transport from './http-transport'
const api = new WPAPI({ endpoint: 'example.com/wp-json', transport })

But… updates to lib most likely to break this anytime soon…

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to change transport request - SAP Community
Go to SE10, open the request, then the task, place the cursor on the report name (the report which you do not wnt...
Read more >
Transport Request Relevant Tables - ERP Great
You can go to table E071 (Change & Transport System: Object Entries of Requests/Tasks) and enter the name of your object in field...
Read more >
What is SAP Transport Request? How to Import/Export TR
Transport Requests (TRs) – are also known as Change Requests. ... Change Task is actually a list of objects that are modified by...
Read more >
Why should you analyse and monitor your SAP Transport ...
A Transport Request typically records the type of change, the purpose of transport, request category, and target system. Each Transport Request ...
Read more >
Advanced Usage — Requests 2.28.1 documentation
Since you are not doing anything special with the Request object, you prepare it immediately and modify the PreparedRequest object. You then send...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found