search

Home  >  Q&A  >  body text

I would like to ask if you can directly access the image resource 403, you can access it on the web page, how to achieve it?

For example

There is no problem accessing the first image from this webpage

https://ask.csdn.net/questions/676365


Access the image link directly in the browser address bar and cannot access it

https://img-ask.csdn.net/upload/201712/29/1514512374_397838.jpg


How do you do this? I also want to make a similar function


**推广网**推广网2363 days ago1517

reply all(4)I'll reply

  • 青Blue

    青Blue2020-06-15 21:55:42

    The other party's server is configured with anti-leeching. Generally, the source is verified, which is the referer field in the http header. When you access the page, the browser has its own Referer field. You enter the URL directly from the address bar and the referer is empty. , so it cannot be accessed. You can use the CURL command line tool to test the specific reason

    reply
    0
  • 秋香姐家的小书童

    秋香姐家的小书童2018-08-10 17:49:10

    URL is sound Principle: When opening a picture, a token is generated and the TOKEN is sent to the corresponding picture server. If the TOKEN is incorrect, the picture cannot be opened


    reply
    0
  • 秋香姐家的小书童

    Authentication

    秋香姐家的小书童 · 2018-08-11 15:19:21
  • Summer

    Summer2018-08-10 09:51:35

    Maybe it’s anti-hotlink protection

    reply
    0
  • Cancelreply