Comments (5)
@NotTheDr01ds Thank you for the http get -ef
command information.
Without the authorisation headers, I was getting an output something like below:
With the auth headers, the original error starts appearing. I tried without 'Content-Type', 'Accept', with them and mixed. In all cases, I am getting the same error × MIME type unknown: application/hal+json;
. Seems the http get
command is not respecting our inputs in this case.
from nushell.
I may be wrong, but shouldn't that be Accept
instead of Content-Type
? curl
sends a default Accept
, which may explain why it's working with curl
but not http get
.
See this Stack Overflow answer for some more detail, including the suggestion of adding -v
to the curl
command to get more info.
from nushell.
@NotTheDr01ds Thank you for the information.
Seems 'Accept' header and 'Content-Type' headers are for different purposes and the same is explained in the below post.
https://stackoverflow.com/questions/35722586/http-headers-accept-and-content-type-in-a-rest-context
In my case, I need to set the 'Content-Type' header only in my request to emphasise that I send a json body (mostly used in put and post.) . For GET request, this parameter is not relevant, I guess. I use nevertheless :)
from nushell.
Agreed - that's what made me think Content-Type
was out of place in this GET
example ;-)
I would suggest comparing the output of curl -v
to that of Nu's http get -ef
. I'm hoping the problem (and hopefully the solution) will be apparent there.
from nushell.
I run into a similar problem. Making a request with HTTPie and bearer token succeeds, while making the same request with the same token using Nushell fails with an authentication error.
Is there a way to debug output the exact HTTP request that Nushell writes to the wire? To check where exactly the two differ?
from nushell.
Related Issues (20)
- Command history should first give the last command in that tab HOT 5
- Add History Hooks HOT 5
- vendor/autoload should respect `XDG_DATA_DIRS` HOT 14
- `error make` ability to reference caller span
- "cd ..." and Tab should show the files in that folder? HOT 5
- New path expansion mangles Bazel targets HOT 1
- A non-closing brace in a file prevents execution by the `use` and `source` commands HOT 1
- the catch block doesn't run when script is interrupted by the user HOT 1
- Some characters should not be *displayed* by `char --list` HOT 8
- Help for main subcommands HOT 3
- find command fails to find CJK contents HOT 2
- Importing a submodule doesn't run its `export-env` unless done during `source`'ing (or the module is defined at the CLI) HOT 1
- Allow x=1 no-spaces variable asignment HOT 14
- couldn't fit table in 269 columns HOT 4
- Screen scrolls up when pressing any key HOT 3
- `watch --quiet` to skip printing message HOT 2
- Support for `+flag` notation HOT 1
- Multiline `input` HOT 2
- Reference to module directory/file path
- Incorrect `$env.FILE_PWD` inside a module - Changes on each import when using a relative path
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nushell.