Skip to content
Advertisement

Tag: http

Writing cookie seems to lose its original value

I seem to be having trouble storing a cookie and then reading back its value. The cookie I’m writing is Name = TransloadingInventory-filter, Value = Consignee:HALLIBURTON ENERGY SERVICES::ProductCategory:1::Product:2. But as soon as I write this value, the browser shows the current value for this cookie is Consignee:::ProductCategory:::Product:. In addition, I don’t know if this is related but when I try

Yelp API Request returning as “undefined”

I am making an API call to the yelp-fusion. However, when I try to log this result, the log shows as undefined. I assume this is due to something regarding promises or async functions. Note: I need to keep this in a function as I intend to export this function to other files. Answer I think you are handling the

Firefox stops receiving responses after some HTTP requests (React + Axios, Node.js backend), sends only OPTIONS

As the title says, this only happens in Firefox. After some time the browser only sends OPTIONS requests with no responses, no status, no headers, nothing I can see in the debug console. All of this works perfectly under Chrome, Safari and Edge. I’ve already set up CORS middleware and headers within NodeJS, so that’s likely not the issue. I’m

How to properly refuse websocket upgrade request?

Sometimes I want to refuse a http client’s request to upgrade connection to websocket. Code (using go’s Gin and gorilla/websocket framework:) To allow upgrade: To refuse upgrade (due to invalid request params): Explaination: Here to refuse the upgrade I just return a http 400 code, then terminate the connection, and didn’t do the upgrade at all. The issue The problem

how to download file using api angular

I have an API that downloads a file, I have a button on the button I have a click that sends a request to the API for download a file, but it doesn’t work request sending successfully but the file is not downloaded, but when I’m adding the URL into the browser the file is successfully downloaded HTML TS Service

Difference between gzip and x-gzip content? If so, how to I decompress x-gzip? zlib is choking

I have a library, published via npm as “by-request”, which can, among other things, auto-decompress web content. Part of the code to handle this situation looks like this: The code had been working pretty well until I tried to read a file of astronomical info from here: https://cdsarc.cds.unistra.fr/viz-bin/nph-Cat/txt.gz?VII/118/names.dat I was hitting the reject(UNSUPPORTED_MEDIA_TYPE) error handler because I hadn’t specifically handled

Advertisement